Hi,
I am having trouble when using convert on a JPEG image from stdin. Other image types (PNG, GIF) work correctly.
More detail:
I have created a Java application that calls convert using this command: convert <type>:- <args> <type>:-
The Java app then writes image bytes to stdin and reads converted image bytes from stdout.
The application works as expected in the following case:
convert png:- -resize 50x50 jpg:-
The command is called, PNG bytes are written to stdin, resized JPG bytes are read from stdout. Yay.
The problem occurs when trying to give JPG input:
convert jpg:- -resize 50x50 jpg:-
The command is called, JPG bytes are written to stdin but convert never writes anything to stdout. :'(
I am 100% certain that the bytes written to stdin are a complete, working JPEG image. They even have expected magic bytes.
Things I have tried:
- Using "jpeg" instead of "jpg" in convert command: convert jpeg:- -resize 50x50! jpeg:-. This did not help.
- I figured that convert may be waiting for the 0xFF, 0xD9 to signal the end of a JPG. I write those bytes to stdin after the image bytes. Did not work.
My convert -version:
Version: ImageMagick 6.6.7-5 2011-02-06 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2011 ImageMagick Studio LLC
Features: OpenMP OpenCL
I am out of ideas and I would appreciate if anyone could offer some help and/or suggestions.
Thanks for making one of the best image tools on the planet.