Page 1 of 1

GIF to JPG using rflag decr fails

Posted: Sat Jan 07, 2006 1:50 pm
by eriksson
Hi all!
I'm using nconvert in a .bat file. Works fine until it's time to convert GIF to JPG using rflag decr, this returns an error. When I remove rflag decr it works ok.

Note: rflag decr does work correctly with other formats I've tested.

So, is this not supported for GIFs? Would be really nice to use it for small images otherwise they will be upsized which sucks. Any ideas?

Great peice of software I can't thank you, the creators, enough!

Re: GIF to JPG using rflag decr fails

Posted: Sat Jan 07, 2006 2:16 pm
by xnview
eriksson wrote:Hi all!
I'm using nconvert in a .bat file. Works fine until it's time to convert GIF to JPG using rflag decr, this returns an error. When I remove rflag decr it works ok.

Note: rflag decr does work correctly with other formats I've tested.

So, is this not supported for GIFs? Would be really nice to use it for small images otherwise they will be upsized which sucks. Any ideas?

Great peice of software I can't thank you, the creators, enough!
Could you post the command line used?

Re: GIF to JPG using rflag decr fails

Posted: Sun Jan 08, 2006 6:37 pm
by eriksson
xnview wrote:Could you post the command line used?
Because I had a problem with GIFs I extended my script, hopefully I will only need one line of code after you reply :D

For GIF:

Code: Select all

nconvert -quiet -out jpeg -o %nr%.jpg -D -npcd 2 -size 256x256+0 -ctype rgb -ratio -rtype lanczos -resize 640 480 source_%nr%%ext%
For others:

Code: Select all

nconvert -quiet -out jpeg -o %nr%.jpg -D -npcd 2 -size 256x256+0 -ctype rgb -ratio -rflag decr -rtype lanczos -resize 640 480 -q 80 -sharpen 40 source_%nr%%ext%
If -rflag decr is included in the GIF code it fails
Cheers!

Re: GIF to JPG using rflag decr fails

Posted: Mon Jan 09, 2006 10:27 am
by xnview
eriksson wrote:
xnview wrote:Could you post the command line used?
Because I had a problem with GIFs I extended my script, hopefully I will only need one line of code after you reply :D

For GIF:

Code: Select all

nconvert -quiet -out jpeg -o %nr%.jpg -D -npcd 2 -size 256x256+0 -ctype rgb -ratio -rtype lanczos -resize 640 480 source_%nr%%ext%
For others:

Code: Select all

nconvert -quiet -out jpeg -o %nr%.jpg -D -npcd 2 -size 256x256+0 -ctype rgb -ratio -rflag decr -rtype lanczos -resize 640 480 -q 80 -sharpen 40 source_%nr%%ext%
If -rflag decr is included in the GIF code it fails
Cheers!
Ok, you must add -truecolors

Re: GIF to JPG using rflag decr fails

Posted: Mon Jan 09, 2006 4:04 pm
by eriksson
xnview wrote:Ok, you must add -truecolors
Thanks that did it!

I was just about to mention that -transparent 100 doesn't work but then I remembered that I'm converting GIF to JPG

I would have converted my GIFs to PNGs to preserve transparency but I need my images to end in .jpg for my "show random image" javascript to work.
Although if I did want to use GIFs/PNGs in my slideshow using javascript I suppose I could check each time an image loads that it did so correctly and if not (onError) then replace .jpg with .gif/.png.

But it's a slideshow so what am I doing caring about GIFs/PNGs anyway :D
Cheers xnview!