1. Convert and save BMP to JPG file
- Posted by SergioGelli Aug 04, 2010
- 1676 views
How do I to converts and save a file "type.bmp" as file "type.jpg"? This conversion is possible, with Euphoria?
Please, someone would have a code example in Euphoria?
2. Re: Convert and save BMP to JPG file
- Posted by otterdad Aug 04, 2010
- 1653 views
How do I to converts and save a file "type.bmp" as file "type.jpg"? This conversion is possible, with Euphoria?
Please, someone would have a code example in Euphoria?
look in the archives for FreeImage. it can convert anything to anything. it might take a little wrapping, but well worth the time.
3. Re: Convert and save BMP to JPG file
- Posted by SergioGelli Aug 04, 2010
- 1671 views
I've tried before http://freeimage.sourceforge.net information on the Site and also on user contributions Euphoria.
My difficulty is I do not understand how they work, I can not mount and use the functions contained in the "freeImage.DLL" within a Euphoria program.
Tommy's contribution is fairly easy, but has no function to save a JPG file, he only uses BMP files
The library of Ryan Rubley, "freeImage.ew" gives no examples and my attempts end in errors
I need a simple example that opens "freeImage.Dll" and save a file using TIFF_JPEG = # 8000 - save using JPEG compression
But I do not know how.
Can anyone help?
4. Re: Convert and save BMP to JPG file
- Posted by ChrisB (moderator) Aug 04, 2010
- 1601 views
have you tried
http://www.rapideuphoria.com/cximage-3.zip
Chris
5. Re: Convert and save BMP to JPG file
- Posted by SergioGelli Aug 06, 2010
- 1563 views
Yes I tried to test the CxImage.
However it is not working
When you open the dll, the function "cxi_INIT" returns zero in "CXIIMAGE.EW" and the file is present and I loaded it again for case was corrupted but remains return zero.
Another issue is that I would, if possible, do not depend on DLLs
But I'll use them if no other alternative.
6. Re: Convert and save BMP to JPG file
- Posted by ChrisB (moderator) Aug 06, 2010
- 1564 views
Hi
It works fine for me -what windows are you using (I use win xp)
Send me your email address to crylex at gmail dot com, and I'll send you the dll I have, just to make sure its not a corrupt one.
cxi_init opens the dll, and then goes on to assign routine ids to the functions within the dll. cxi_init returns 0 if it either can't open the dll, or it can't assign one of the functions. It would be interesting to know which of these sections is returning the 0. Try changing the first 'return 0' to 'return -1' and see what happens.
Also try putting cximage.dll in \windows\system32 - sometimes this works, though I don't need to on mine.
dlls are the best way to go, trying to code a convertor in euphoria would be way more hassle than its worth. To be honest, if you can't get cximage to work, then just use one of the many command line enabled convertors.
Chris
7. Re: Convert and save BMP to JPG file
- Posted by ArthurCrump Sep 11, 2010
- 1476 views
I've tried before http://freeimage.sourceforge.net information on the Site and also on user contributions Euphoria.
My difficulty is I do not understand how they work, I can not mount and use the functions contained in the "freeImage.DLL" within a Euphoria program.
Tommy's contribution is fairly easy, but has no function to save a JPG file, he only uses BMP files
The library of Ryan Rubley, "freeImage.ew" gives no examples and my attempts end in errors
I need a simple example that opens "freeImage.Dll" and save a file using TIFF_JPEG = # 8000 - save using JPEG compression
But I do not know how.
Can anyone help?
I have finally got round to offering a 'save' function to the Euphoria Archive.
It uses freeimage and is likely to be the latest entry in the Archive.
It is only the save function, so you will need Tommy Carlier's freedib as well.
You should be able to write:
status = SaveFreeDib(DIB,file,24,TIFF_JPEG)
Please let me know if it works; either by the email address indicated in the distribution or via the forum.
8. Re: Convert and save BMP to JPG file
- Posted by sergelli Sep 12, 2010
- 1420 views
I have finally got round to offering a 'save' function to the Euphoria Archive.
Arthur
You did an excellent job!
1-Precision.
2-Very well explained.
3-Straight to the target.
4-No frills.
Many, many thanks
9. Re: Convert and save BMP to JPG file
- Posted by ArthurCrump Sep 12, 2010
- 1390 views
Thank you for the positive feedback.
It's good to know that it works for somebody else.
Arthur