imazen / imageflow-dotnet

The official .NET API for Imageflow, the Rust image processing and optimization engine for web servers
GNU Affero General Public License v3.0
143 stars 25 forks source link

ImageMalformed Error #46

Closed DanPatten closed 8 months ago

DanPatten commented 1 year ago

I am getting the following error on some images, are these images not readable by imageflow?

Imageflow.Bindings.ImageflowException: ImageMalformed: Error 9: Wrong input color space on transform (ObjectCreationError) at imageflow_core\src\codecs\color_transform_cache.rs:126:197 https://github.com/imazen/imageflow/blob/22a2bf99f278d4dd7b8da65ee1604b5f84eb1d50/imageflow_core/src/codecs/color_transform_cache.rs#L126 imageflow_core\src\codecs\color_transform_cache.rs:190:148 https://github.com/imazen/imageflow/blob/22a2bf99f278d4dd7b8da65ee1604b5f84eb1d50/imageflow_core/src/codecs/color_transform_cache.rs#L190 imageflow_core\src\codecs\libpng_decoder.rs:287:39 https://github.com/imazen/imageflow/blob/22a2bf99f278d4dd7b8da65ee1604b5f84eb1d50/imageflow_core/src/codecs/libpng_decoder.rs#L287 imageflow_core\src\flow\nodes\codecs_and_pointer.rs:222:65 https://github.com/imazen/imageflow/blob/22a2bf99f278d4dd7b8da65ee1604b5f84eb1d50/imageflow_core/src/flow/nodes/codecs_and_pointer.rs#L222 imageflow_core\src\flow\execution_engine.rs:477:114 https://github.com/imazen/imageflow/blob/22a2bf99f278d4dd7b8da65ee1604b5f84eb1d50/imageflow_core/src/flow/execution_engine.rs#L477 imageflow_core\src\context.rs:419:59 https://github.com/imazen/imageflow/blob/22a2bf99f278d4dd7b8da65ee1604b5f84eb1d50/imageflow_core/src/context.rs#L419 imageflow_core\src\context_methods.rs:50:68 https://github.com/imazen/imageflow/blob/22a2bf99f278d4dd7b8da65ee1604b5f84eb1d50/imageflow_core/src/context_methods.rs#L50 Active node: NodeDebugInfo { stable_id: 2, params: Json( Decode { io_id: 0, commands: None, }, ), index: NodeIndex(1), }

lilith commented 1 year ago

Can you zip those images (to prevent github recompression) and share a link to them?

On Tue, Apr 4, 2023, 8:56 AM DanPatten @.***> wrote:

I am getting the following error on some images, are these images not readable by imageflow?

Imageflow.Bindings.ImageflowException: ImageMalformed: Error 9: Wrong input color space on transform (ObjectCreationError) at imageflow_core\src\codecs\color_transform_cache.rs:126:197 https://github.com/imazen/imageflow/blob/22a2bf99f278d4dd7b8da65ee1604b5f84eb1d50/imageflow_core/src/codecs/color_transform_cache.rs#L126 imageflow_core\src\codecs\color_transform_cache.rs:190:148 https://github.com/imazen/imageflow/blob/22a2bf99f278d4dd7b8da65ee1604b5f84eb1d50/imageflow_core/src/codecs/color_transform_cache.rs#L190 imageflow_core\src\codecs\libpng_decoder.rs:287:39 https://github.com/imazen/imageflow/blob/22a2bf99f278d4dd7b8da65ee1604b5f84eb1d50/imageflow_core/src/codecs/libpng_decoder.rs#L287 imageflow_core\src\flow\nodes\codecs_and_pointer.rs:222:65 https://github.com/imazen/imageflow/blob/22a2bf99f278d4dd7b8da65ee1604b5f84eb1d50/imageflow_core/src/flow/nodes/codecs_and_pointer.rs#L222 imageflow_core\src\flow\execution_engine.rs:477:114 https://github.com/imazen/imageflow/blob/22a2bf99f278d4dd7b8da65ee1604b5f84eb1d50/imageflow_core/src/flow/execution_engine.rs#L477 imageflow_core\src\context.rs:419:59 https://github.com/imazen/imageflow/blob/22a2bf99f278d4dd7b8da65ee1604b5f84eb1d50/imageflow_core/src/context.rs#L419 imageflow_core\src\context_methods.rs:50:68 https://github.com/imazen/imageflow/blob/22a2bf99f278d4dd7b8da65ee1604b5f84eb1d50/imageflow_core/src/context_methods.rs#L50 Active node: NodeDebugInfo { stable_id: 2, params: Json( Decode { io_id: 0, commands: None, }, ), index: NodeIndex(1), }

— Reply to this email directly, view it on GitHub https://github.com/imazen/imageflow-dotnet/issues/46, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAA2LH5RLYK5O3RQHOOLMADW7QZAJANCNFSM6AAAAAAWS2VZAE . You are receiving this because you are subscribed to this thread.Message ID: @.***>

DanPatten commented 1 year ago

@lilith printLogo (2).zip

Here is the zipped image.

Here is the code I am using:

height=120, width=224,fitMode=null

using (var b = new ImageJob())
            {
                await b.BuildCommandString(
                     new StreamSource(streamIn, false),
                     new StreamDestination(streamOut, false),
                     $"width={width}&height={height}&mode={fitMode}")
                     .Finish().InProcessAsync();
            }

            return streamOut;
lilith commented 9 months ago

Have you tried adding &ignore_icc_errors=true