Skip to content

Conversation

@jeremylevy
Copy link
Contributor

Currently when imagemagick display warnings like this:

identify: iCCP: known incorrect sRGB profile `letter.png' @ warning/png.c/MagickPNGWarningHandler/1832.
PNG 8 1024 1024 20634B 28.350000000000001421 letter.png

node-easyimage takes this as fatal error and return immediately with a File not supported error.

I've updated error handling to manage the case where warnings are returned in stderr alongs with response in stdout. I've also passed stderr as Error message rather than unhelpful File not supported error.

@hacksparrow
Copy link
Owner

Test valid file type with warning is failing.

@jeremylevy
Copy link
Contributor Author

All tests pass for me. I think the warning sent by imagemagick depends on version.

identify -format "%m %z %w %h %b %x %f" letter.png

display:

identify: iCCP: known incorrect sRGB profile `letter.png' @ warning/png.c/MagickPNGWarningHandler/1832.
PNG 8 1024 1024 20634B 28.350000000000001421 letter.png

for version: ImageMagick 6.8.9-1 Q16 x86_64 2014-09-13

Can you please, check the output for your ImageMagick version ?

I will remove warning test if it turned out.

@hacksparrow
Copy link
Owner

ImageMagick 6.8.9-5 Q16 x86_64 2014-07-25

@jeremylevy
Copy link
Contributor Author

Ok. And the output for the command:

identify -format "%m %z %w %h %b %x %f" letter.png

@hacksparrow
Copy link
Owner

PNG 8 1024 1024 20634B 28.350000000000001421 letter.png

@jeremylevy
Copy link
Contributor Author

Thanks ! So warnings sent depend on ImageMagick version. I will remove the warning test. If you have any ideas to test for warnings sent, please let me known.

@itsyogesh
Copy link

Well this works for me. Before this i was just bypassing the whole error handling regex by putting a placeholder like /^error:/ or something so that it gets the information about png files.

@jeremylevy
Copy link
Contributor Author

Yes, it seems that displayed warnings depend on installed version of ImageMagick so unit tests for this specific case are very difficult to made. If you have any ideas to test for this case, please let me known I will add a commit.

@itsyogesh
Copy link

Well writing unit tests will be a difficult task to do since we need dependencies based on the version of imageMagick. Otherwise we can create conditions based on specific imageMagick versions.

@jeremylevy
Copy link
Contributor Author

Yes, of course. I will wait for the response of repo owner. Thanks.

@jeremylevy jeremylevy closed this Oct 9, 2014
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

Successfully merging this pull request may close these issues.

3 participants