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
Error: Improper Image header #579
Comments
One possible solution, ensure you are a recent release of ImageMagick. Another is that the image file is corrupt. Post a URL to your image here so we can download it and inspect it for corruption. |
I get the same intermittent failure with image magick - and am using: Version: ImageMagick 7.0.6-0 Q16 x86_64 2017-06-12 http://www.imagemagick.org I will try updating to the latest version (7.0.6.7), and see if that makes a difference. Oops - homebrew only has up to v7.0.6.6. I will try with that version first. But upgrading imagemagick also upgraded a lot of other libraries for me (jpeg, libpng, libtiff). Maybe one of those was returning a bogus, intermittent error? |
No, that was not the issue. I use Fastlane to call the badge function, which uses a mini_magick gem (v4.5.1) to add two badges at the top of the application icons. This combination works most of the time (9 out of 10 times?) Sometimes, though, the combination produces a failure in parsing what looks like an intermediate PNG. My latest theory is that some combination of the mini_magick gem (v4.5.1) and the badge gem (v0.8.4) might be trying to start a subsequent operation before a previous operation completes? Here is the rather cryptic and less than totally helpful error message I get: Something went wrong while running badge: Does anyone have any ideas what might be going wrong? |
Here is line 4232 of coders/png.c from IM-7.0.6-7:
So it's saying the PNG magic number (the first 8 bytes of the PNG file) were Can you upload that intermediate PNG image (/var/folders/57/dhl6f07524q0ygmthfjz4n1h0000gn/T/mini_magick20170812-34515-gelu3n.png in this run, some other name in var/folders/* each time |
Here is the initial image's header information:
I am not certain how to get the intermediate file's header, since the files are deleted after an unsuccessful run. I keep trying to put a byebug immediately after the badge command -- but now it refuses to fail for me. SIGH. I will keep trying! |
For me this error is quite frequent while using with fastlane. Earlier I never faced this issue but recently its quite frequent. I am using the attached image for badging. The image is picked from the temp location and it throws the error. improper image header `/var/folders/fc/lp0tsgx51_ldd7m_v7_zqnc800007q/T/mini_magick20170817-65853-6zr79y.png' @ error/png.c/ReadPNGImage/3933. |
I also call badge from fast lane, and I've been seeing this error too, sporadically though. My build server logs just showed me the error, but when I re-ran the command through the command line, everything worked fine. |
Badge Green just got updated to fix this issue. Seems that the server used for generating badges sometimes just returns am error. Badge Gem was packaging that text into a JPG file, ignoring the return code. Then Badge was sending that text-instead-of-image file to imagemagick, which was throwing the exception. |
@wolfe719 Is this fix live? |
I am not facing any issues with the badge. But I changed the way I am using badge. https://github.com/HazAT/fastlane-plugin-badge If you are using fastlane, then please use the above plugin for things to work without any issues. |
I am using image magick to label my application icon through fastlane.
But my build randomly fails because of the below error. Sometimes it works fine and fails on other occassions. I am running the build on Jenkins on a Mac machine.
[03:09:38]: �[31mfastlane finished with errors�[0m
�[31m
[!] Something went wrong while running badge:
identify /var/folders/fc/lp0tsgx51_ldd7m_v7_zqnc800007q/T/mini_magick20170717-56250-alhq3a.png
failed with error:identify: improper image header `/var/folders/fc/lp0tsgx51_ldd7m_v7_zqnc800007q/T/mini_magick20170717-56250-alhq3a.png' @ error/png.c/ReadPNGImage/3933.
�[0m
The text was updated successfully, but these errors were encountered: