GIF to JPG using rflag decr fails

Discussions on NConvert - the command line tool for image conversion and manipulation

Moderators: helmut, XnTriq, xnview

Post Reply
eriksson
Posts: 3
Joined: Sat Jan 07, 2006 1:40 pm

GIF to JPG using rflag decr fails

Post 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!
User avatar
xnview
Author of XnView
Posts: 46236
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: GIF to JPG using rflag decr fails

Post 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?
Pierre.
eriksson
Posts: 3
Joined: Sat Jan 07, 2006 1:40 pm

Re: GIF to JPG using rflag decr fails

Post 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!
User avatar
xnview
Author of XnView
Posts: 46236
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: GIF to JPG using rflag decr fails

Post 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
Pierre.
eriksson
Posts: 3
Joined: Sat Jan 07, 2006 1:40 pm

Re: GIF to JPG using rflag decr fails

Post 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!
Post Reply