-
Notifications
You must be signed in to change notification settings - Fork 418
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
fastcrush=1 and dc-scan-opt=0 are incompatible and cause crash/error #249
Comments
Indeed, these options don't make sense together. Would you like to make a pull request that fixes it? I suppose the best way to fix it would be not to attempt DC scan optimizations if progressive rendering is not enabled. |
Thanks for the quick reply @pornel! I might be just looking at this too long, but I think both flags should result in progressive outputs. Afaict, the This is what I get from running the output through exiftool ( [user:mozjpeg]$ ./cjpeg testimages/nightshot_iso_100.bmp > foo.jpg && exiftool -v3 foo.jpg | grep -e SOS -e SOF
JPEG SOF2 (15 bytes):
JPEG SOS // DC1
JPEG SOS // DC2
JPEG SOS // DC3
JPEG SOS
JPEG SOS
JPEG SOS
JPEG SOS
[user:mozjpeg]$ ./cjpeg -fastcrush testimages/nightshot_iso_100.bmp > foo.jpg && exiftool -v3 foo.jpg | grep -e SOS -e SOF
JPEG SOF2 (15 bytes):
JPEG SOS // DC1
JPEG SOS // DC2
JPEG SOS // DC3
JPEG SOS
JPEG SOS
JPEG SOS
JPEG SOS
JPEG SOS
JPEG SOS
JPEG SOS
[user:mozjpeg]$ ./cjpeg -dc-scan-opt 0 testimages/nightshot_iso_100.bmp > foo.jpg && exiftool -v3 foo.jpg | grep -e SOS -e SOF
JPEG SOF2 (15 bytes):
JPEG SOS // DC1 DC2 DC3
JPEG SOS
JPEG SOS
JPEG SOS
JPEG SOS Maybe I'm just misinterpreting the results, but it seems to me that they all have multiple scans and the So when setting both flags I'd expect the 2nd output, but with the first three ones merged. Resulting in 8 scans in the resulting JPEG. Or is there another way to ensure to have all DC bands in one scan for JBOOLEAN_OPTIMIZE_SCANS=false? Otherwise, I'd try with the "-scans file" option. |
I've found the bug and the fix :) hopefully send you the pull-request soon |
Hi, if I'm both enabling fastcrush (disabling scan optimization) and setting scan-opt-mode to 0, the
cjpeg
tool ends in an error state. The same is true when trying to set this setting combination in code.Observed behaviour and repro:
Setting both options crashes the
cjpeg
CLI tool and results in an error. The output file is empty.Expected behaviour:
cjpeg
tool creates a valid JPG output file-fastcrush
optionAlternative expected behaviour:
cjpeg
tools produces an output that both options are not supported at the same time--help
summaryHowever, I don't think that there should be a hard technical reason why the two options cannot be used together.
More information:
OS: MAC OS 10.12.3
MozJpeg: version3.2 (fresh from the pre-release page) - also tried the variant that's served via brew (version3.1)
Related code settings:
The behavior can also be triggered with the following code in a call-site:
The text was updated successfully, but these errors were encountered: