Clean app markers increases the image file size

*** Please report new bugs here! ***

Moderators: xnview, Dreamer

hor0124
Posts: 3
Joined: Tue Jun 23, 2026 9:07 am

Clean app markers increases the image file size

Post by hor0124 »

XnView: MP 1.11.5 - 64 bit
OS: Windows 11 25H2

I use GIMP to fix Some old images.
When I try to use the "clean all other markers" option (from the clean metadata function) the image file size increases
The image has no other metadata information.

I noted the same behaviour from files before I even edited them (right after I scanned the image.)

How can this be? shouldn't clean shrink the file (or at least keep it the same?)
cday
XnThusiast
Posts: 4612
Joined: Sun Apr 29, 2012 9:45 am
Location: Cheltenham, U.K.

Re: Clean app markers increases the image file size

Post by cday »

Are you able to post example 'Before' and 'After' files for someone to inspect?
User avatar
user0
XnThusiast
Posts: 3093
Joined: Sat May 09, 2015 9:37 am

Re: Clean app markers increases the image file size

Post by user0 »

check your format write settings in Settings>Formats>Write
hor0124
Posts: 3
Joined: Tue Jun 23, 2026 9:07 am

Re: Clean app markers increases the image file size

Post by hor0124 »

Here is a simple example I created (don't be alarmed - it's a black rectangle).
You do not have the required permissions to view the files attached to this post.
User avatar
user0
XnThusiast
Posts: 3093
Joined: Sat May 09, 2015 9:37 am

Re: Clean app markers increases the image file size

Post by user0 »

check 'Optimize Huffman table'
hor0124
Posts: 3
Joined: Tue Jun 23, 2026 9:07 am

Re: Clean app markers increases the image file size

Post by hor0124 »

Thanks user0.
May I ask that you specify what the setting should be instead of just saying "check".

Some more examples
Before - Copy (2) is fresh out of Gimp 3.24.
After - Copy (2) is after "cleaning" with 'Optimize Huffman table' turned on.
You do not have the required permissions to view the files attached to this post.
User avatar
user0
XnThusiast
Posts: 3093
Joined: Sat May 09, 2015 9:37 am

Re: Clean app markers increases the image file size

Post by user0 »

there are 2 ways to remove metadata in XnViewMP
  • in Viewer
    it only affects the loaded image, so the image must be saved (encoded) and Write settings will be used
  • in Browser (your case)
    it does not re-encode image, so the bitstream should theoretically remain identical

However, it looks like XnViewMP uses jpegtran (from libJPEG/turbo) which affects bitsteam,
if you want to strip all metadata w/o touching bitstream - use exiftool

Test
test with your 2nd example file (1.28 KiB)
  • XnViewMP OR jpegtran
    jpegtran -copy none -outfile 2_jpegtran.jpg 1.jpg
    Browser>Metadata>Clean... - all checkboxes, except huffman optimization
    4.97 KiB bitstream changed, APP0 remains

    jpegtran -copy none -optimize -outfile 2_jpegtran_optimize.jpg 1.jpg
    Browser>Metadata>Clean... - all checkboxes
    2.51 KiB bitstream changed, APP0 remains
  • exiftool
    exiftool -all= -o 3_exiftool_all.jpg 1.jpg
    1.26 KiB bitstream unchanged, all metadata removed