Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"JFIF" part of jpg header #152

Open
necros2k7 opened this issue Jun 21, 2023 · 8 comments
Open

"JFIF" part of jpg header #152

necros2k7 opened this issue Jun 21, 2023 · 8 comments

Comments

@necros2k7
Copy link

Am I miss smthing? Or JFIF part of header was deleted in previous versions? And now not.

@tjko
Copy link
Owner

tjko commented Jun 22, 2023

I seem to recall that, jpegoptim discards any JFIF marker(s) found in the input image, since libjpeg adds one in the output image on its own. This is done to avoid "duplicate" JFIF markers in the output file.

If you've noticed change in behaviour that likely is caused by compiling jpegoptim against different version of libjpeg (or using different compatible library like libjpeg-turbo or mozjpeg).

@necros2k7
Copy link
Author

Your latest win64 win binary keeps it - яШяа �JFIF �� � �

@tjko
Copy link
Owner

tjko commented Jun 22, 2023

I had never given much thought about how JFIF markers were handled. It was left to whatever was default behavior of the JPEG library being used.

I made change (22b1dd8) to add options to specify whether to keep or remove those (--keep-jfif and --strip-jfif). While default is to preserve JFIF marker (if its present in input file).

https://github.com/tjko/jpegoptim/actions/runs/5342050032

@necros2k7
Copy link
Author

necros2k7 commented Jun 22, 2023

@tjko Thanx, it`s exactly what I meant, can you make --strip-jfif default option as it was before?

@necros2k7
Copy link
Author

@tkjo can you fix artifacts` expiration pls? wanted to test latest build with --strip-jiff option

@tjko
Copy link
Owner

tjko commented Jul 27, 2023

@necros2k7, artifacts expire after couple months (thats under github's control). This fix will be in next release that I hopefully have time to in next couple days.

@necros2k7
Copy link
Author

@tjko JFIF header came back again) --strip-jfif doesn`t work

@necros2k7 necros2k7 reopened this Mar 16, 2024
@tjko
Copy link
Owner

tjko commented Mar 17, 2024

I don't see issue with the latest version. Can you provide some more details?

Results testing with the (MacOS) binary from the latest release:

$ ./jpegoptim test.jpg
test.jpg 1944x2592 24bit N JFIF,Exif,XMP,XMP,ICC [OK] 1370168 --> 1370168 bytes (0.00%), skipped.
$ ./jpegoptim test.jpg --strip-jfif
test.jpg 1944x2592 24bit N JFIF,Exif,XMP,XMP,ICC [OK] 1370168 --> 1370150 bytes (0.00%), optimized.
$ ./jpegoptim test.jpg             
test.jpg 1944x2592 24bit N Exif,XMP,XMP,ICC [OK] 1370150 --> 1370150 bytes (0.00%), skipped.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants