Rc1: Cleaned jpg increased file size.

Bugs found in XnView Classic. Please report only one bug per topic!

Moderators: XnTriq, helmut, xnview

Taboc

Rc1: Cleaned jpg increased file size.

Post by Taboc »

Some jpg increase file size when Clean:Optimize huffman table is unchecked.

http://img64.imageshack.us/img64/3416/13kz1.jpg
http://img64.imageshack.us/img64/7514/22ju1.jpg

XnView 1.82 -
Xyzzy
Posts: 652
Joined: Tue Nov 23, 2004 10:17 pm
Location: Poland

Post by Xyzzy »

Yes, there is something wrong about Clean.

Files with no EXIF/IPTC data grow after they are cleaned with EXIF/IPTC related options checked.

X.
User avatar
xnview
Author of XnView
Posts: 45495
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: Rc1: Cleaned jpg increased file size.

Post by xnview »

Taboc wrote:Some jpg increase file size when Clean:Optimize huffman table is unchecked.
Seems to be correct :-) All other software with a clean feature have this behaviour...
Pierre.
Dreamer
XnThusiast
Posts: 4608
Joined: Sun Jul 25, 2004 9:08 pm

Re: Rc1: Cleaned jpg increased file size.

Post by Dreamer »

xnview wrote:
Taboc wrote:Some jpg increase file size when Clean:Optimize huffman table is unchecked.
Seems to be correct :-) All other software with a clean feature have this behaviour...
So close?
User avatar
Clo
XnThusiast
Posts: 4441
Joined: Sun Oct 17, 2004 4:57 am
Location: Bordeaux, France

Not always…

Post by Clo »

:) Hello !
Seems to be correct All other softwares with a clean feature have this behaviour…
… that doesn't mean it's normal and logical…

- I tested with the image below, and got a small gain at size, ~4KB less…

—————Image

- Please, could you check whether you get the same ?
{ BTW : the caption on the pic tells «I've also MY anti-virus ;) }

:mrgreen: Kind regards,
Claude'
Clo
Last edited by Clo on Sun Jan 15, 2006 12:51 am, edited 1 time in total.
Old user ON SELECTIVE STRIKE till further notice
FlorianH
Posts: 121
Joined: Fri Dec 09, 2005 8:28 am
Location: Munich, Germany

Re: Not always…

Post by FlorianH »

Clo wrote:- Please, could you check whether you get the same ?
I can confirm:

a) original file 58.191 bytes
b) original file cleaned with all options except optimize -> 58.191 bytes (same size)
c) original file cleaned with all options (incl. optimize) -> 54.259 bytes
d) file c) cleaned with all options except optimize -> 58.191 bytes strange!

I think from the technical point of view (pierre's view?), behaviour b) is ok. But behaviour d) is not realy easy to explain...
Dreamer
XnThusiast
Posts: 4608
Joined: Sun Jul 25, 2004 9:08 pm

Post by Dreamer »

Moved back to New/Open, since it's still not clear if current behavior is standard or not.
User avatar
xnview
Author of XnView
Posts: 45495
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Post by xnview »

Dreamer wrote:Moved back to New/Open, since it's still not clear if current behavior is standard or not.
There is no bug here :-)
Pierre.
User avatar
Olivier_G
XnThusiast
Posts: 1423
Joined: Thu Dec 23, 2004 7:17 pm
Location: Paris, France

Post by Olivier_G »

Seems strange that removing data actually increase filesize... :(
-> can't you actually remove the corresponding metadata space completely ?
User avatar
xnview
Author of XnView
Posts: 45495
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Post by xnview »

Olivier_G wrote:Seems strange that removing data actually increase filesize... :(
-> can't you actually remove the corresponding metadata space completely ?
Metadata is removed, but i think that huffmann code is rearranged.
Pierre.
Xyzzy
Posts: 652
Joined: Tue Nov 23, 2004 10:17 pm
Location: Poland

Post by Xyzzy »

xnview wrote:
Olivier_G wrote:Seems strange that removing data actually increase filesize... :(
-> can't you actually remove the corresponding metadata space completely ?
Metadata is removed, but i think that huffmann code is rearranged.
OK, I think this solves the puzzle. But is there any need to NOT optimize Huffman tree?

X.
User avatar
Olivier_G
XnThusiast
Posts: 1423
Joined: Thu Dec 23, 2004 7:17 pm
Location: Paris, France

Post by Olivier_G »

More tests:
I converted a TIFF to JPEG (no Huff Optimization) -> image without metadata: 323644 B
I added several IPTC&Comments -> 323977 B
I cleaned those metadata (no Huff Optimize) -> 323644 B
=> back to original size without metadata (optimize Huff gives 320305 B).

It looks fine to me regarding the way metadata are handled.
(and also regarding Huffman table optimization)

Olivier
Xyzzy
Posts: 652
Joined: Tue Nov 23, 2004 10:17 pm
Location: Poland

Post by Xyzzy »

Xyzzy wrote: OK, I think this solves the puzzle. But is there any need to NOT optimize Huffman tree?
Self-reply :)

Yes, when there is image with already optimized coding (fe. by some specialized packer)- applying Huffman could grow it. Looking at Olivier_G test it can be Closed, right?

X.