Closed aheintz closed 4 years ago
This looks like an sRGB image with a CMYK color profile attached. Clearly that doesn't make sense, so Imageflow throws this error.
To ignore the error, use &ignore_icc_errors=true
in the command string.
Thanks for the response. I agree that it doesn't make sense. Unfortunately, &ignore_icc_errors=true
doesn't make any difference (I'm using the .net dotnet library if that makes any difference, and are indeed using the ResizerCommands
method).
I resolved my problem by using ImageMagick to correct the color profile if ImageFlow fails. It doesn't seem to be a terribly uncommon problem, I'm having quite a few images with this "error".
Using ignoreicc=true
works, but that doesn't feel right (emphasis on "feel", since I honestly don't know). I'm using 1.4.10-rc50
btw.
I tested ignore_icc_errors with that image and it worked. Could you share the full C# code you are using?
On Thu, Sep 17, 2020, 9:45 AM Anders Heintz notifications@github.com wrote:
Thanks for the response. I agree that it doesn't make sense. Unfortunately, &ignore_icc_errors=true doesn't make any difference (I'm using the .net dotnet library if that makes any difference, and are indeed using the ResizerCommands method).
I resolved my problem by using ImageMagick to correct the color profile if ImageFlow fails. It doesn't seem to be a terribly uncommon problem, I'm having quite a few images with this "error".
— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/imazen/imageflow/issues/512#issuecomment-694323145, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAA2LH4Y5BR5TLTV4P3YEDTSGIVKNANCNFSM4ROVP7GQ .
Thanks for your quick reply!
This is the code I'm using and generates the same stacktrace as above.
var client = httpClientFactory.CreateClient();
var stream = await client.GetStreamAsync("https://media.cdn.storm.io/62/fa457334-0cd4-4839-ad6d-1808f921f5e6");
await b.Decode(stream, false)
.ResizerCommands("width=200&ignore_icc_errors=true")
.EncodeToStream(output, false, new MozJpegEncoder(90))
.Finish()
.WithSecurityOptions(new SecurityOptions
{
MaxFrameSize = new FrameSizeLimit(30000, 30000, 200),
MaxDecodeSize = new FrameSizeLimit(30000, 30000, 200),
MaxEncodeSize = new FrameSizeLimit(30000, 30000, 200)
})
.InProcessAndDisposeAsync();
Use b.BuildCommandString instead. You're decoding the image before applying the ignore_icc_errors command.
On Thu, Sep 17, 2020, 10:18 AM Anders Heintz notifications@github.com wrote:
Thanks for your quick reply!
This is the code I'm using and generates the same stacktrace as above.
var client = httpClientFactory.CreateClient(); var stream = await client.GetStreamAsync("https://media.cdn.storm.io/62/fa457334-0cd4-4839-ad6d-1808f921f5e6"); await b.Decode(stream, false) .ResizerCommands("width=200&ignore_icc_errors=true") .EncodeToStream(output, false, new MozJpegEncoder(90)) .Finish() .WithSecurityOptions(new SecurityOptions { MaxFrameSize = new FrameSizeLimit(30000, 30000, 200), MaxDecodeSize = new FrameSizeLimit(30000, 30000, 200), MaxEncodeSize = new FrameSizeLimit(30000, 30000, 200) }) .InProcessAndDisposeAsync();
— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/imazen/imageflow/issues/512#issuecomment-694341907, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAA2LH4RN5QY33YK5JU5I53SGIZFBANCNFSM4ROVP7GQ .
Oh, that worked like a charm! Thanks for your help, saved my night! 😄
@lilith how can we apply this to the node package?
What code are you currently using?
On Mon, Dec 14, 2020, 12:08 PM Patrick Michalina notifications@github.com wrote:
@lilith https://github.com/lilith how can we apply this to the node package?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/imazen/imageflow/issues/512#issuecomment-744647356, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAA2LH43PAO6EGIT24I62WDSUZPBVANCNFSM4ROVP7GQ .
This sort of flow is how we are doing it:
const streams = this.prepareStreamsForProcess(asset, hash)
const inStream = new FromStream(streams.input)
const outStream = new FromStream(streams.output)
return new Steps(inStream)
.constrainWithin(query.width, query.height)
.encode(outStream, this.getFormat(query.format, query.quality))
.execute()
All of a sudden getting a bunch of these errors "Wrong input color space on transform" and wondering how to possibly mute this like noted in the thread here.
/home/runner/.cargo/git/checkouts/imageflow-ce6f29762d899395/1a7e1ee/imageflow_core/src/codecs/color_transform_cache.rs:126:197
@patrickmichalina I will check if we support these options in the nodejs package, if not I will add it.
@anshulrgoyal much appreciated!
@patrickmichalina We have added a new DecodeOptions type to the imageflow node which passed as the second argument to the decode
method and Step class constructor. I will release the update package within a few minutes and it will be available in a few hours.
@patrickmichalina The package is live and I have added an example in read me.
Fantastic thank you very much appreciated for the quick update. This will fix our production tool
Transforming the image below returns an error (using the dotnet library), and I cannot really figure out why:
The image: https://media.cdn.storm.io/62/fa457334-0cd4-4839-ad6d-1808f921f5e6