1. Convert and save BMP to JPG file

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?

new topic     » topic index » view message » categorize

2. Re: Convert and save BMP to JPG file

SergioGelli said...

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.

OtterDad

new topic     » goto parent     » topic index » view message » categorize

3. Re: Convert and save BMP to JPG file

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?

new topic     » goto parent     » topic index » view message » categorize

4. Re: Convert and save BMP to JPG file

have you tried

http://www.rapideuphoria.com/cximage-3.zip

Chris

new topic     » goto parent     » topic index » view message » categorize

5. Re: Convert and save BMP to JPG file

ChrisB said...

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.

new topic     » goto parent     » topic index » view message » categorize

6. Re: Convert and save BMP to JPG file

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.

http://www.google.co.uk/search?source=ig&hl=en&rlz=&=&q=command+line+convert+bmp+to+jpg&aq=f&aqi=g1&aql=&oq=&gs_rfai=

Chris

new topic     » goto parent     » topic index » view message » categorize

7. Re: Convert and save BMP to JPG file

SergioGelli said...

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.

new topic     » goto parent     » topic index » view message » categorize

8. Re: Convert and save BMP to JPG file

ArthurCrump said...

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

new topic     » goto parent     » topic index » view message » categorize

9. Re: Convert and save BMP to JPG file

Thank you for the positive feedback.
It's good to know that it works for somebody else.

Arthur

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu