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

White Space Trimming: ArgumentInvalid: LayoutError: ContentDependent #24

Closed bwaldron closed 3 years ago

bwaldron commented 3 years ago

Imageflow.Net (0.7.19) Imageflow.NativeRuntime.win-x86_64 (1.5.3-rc57)

In going from ImageResizer to ImageFlow, we are seeing exceptions within white space trimming only with resize and other querystring operations working as documented. I am likely missing something obvious, but wanted to see if there is an underlying bug.

For example, with a any valid image all of the following will result in the same error:

var result = await job.BuildCommandString(new StreamSource(stream, false), new BytesDestination(), "trim.threshold=80").Finish().InProcessAsync();
var result = await job.BuildCommandString(new BytesSource(bytes), new BytesDestination(), "trim.threshold=80").Finish().InProcessAsync();
var result = await job.Decode(bytes).ResizerCommands(BuildCommandString(new BytesSource(bytes), new BytesDestination(), "trim.threshold=80").Finish().InProcessAsync();
ArgumentInvalid: LayoutError: ContentDependent at
imageflow_core\src\flow\nodes\constrain.rs:85:101
https://github.com/imazen/imageflow/blob/478fafef4c83446f9415b7502f6a6712af00cf32/imageflow_core\src\flow\nodes\constrain.rs#L85
imageflow_core\src\flow\execution_engine.rs:296:29
https://github.com/imazen/imageflow/blob/478fafef4c83446f9415b7502f6a6712af00cf32/imageflow_core\src\flow\execution_engine.rs#L296
imageflow_core\src\context.rs:419:59
https://github.com/imazen/imageflow/blob/478fafef4c83446f9415b7502f6a6712af00cf32/imageflow_core\src\context.rs#L419
imageflow_core\src\context_methods.rs:50:68
https://github.com/imazen/imageflow/blob/478fafef4c83446f9415b7502f6a6712af00cf32/imageflow_core\src\context_methods.rs#L50
Active node:
NodeDebugInfo {
    stable_id: 1,
    params: Json(
        CommandString {
            kind: ImageResizer4,
            value: "trim.threshold=80",
            decode: Some(
                0,
            ),
            encode: Some(
                1,
            ),
            watermarks: None,
        },
    ),
    index: NodeIndex(0),
}
lilith commented 3 years ago

It's not you, it's me. I forgot to add an integration test for this command. I'm working on a fix, but currently our release system is down (TravisCI OS X builds have stopped working), so we're in the middle of migrating to a new release system based on Github Actions. So it could be 1-2 weeks.

bwaldron commented 3 years ago

I understand and appreciate the heads up, is it isolated to trim.threshold? We use the ImageResizer querystring methods currently and are comfortable with the items that your team documented that aren't supported going forward.

lilith commented 3 years ago

It's isolated to the whitespace trimming feature, yes.

On Wed, Dec 9, 2020, 10:33 PM Ben Waldron notifications@github.com wrote:

I understand and appreciate the heads up, is it isolated to trim.threshold? We use the ImageResizer querystring methods currently and are comfortable that your team documented that aren't supported.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/imazen/imageflow-dotnet/issues/24#issuecomment-742251608, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAA2LHZJHLYCLXOMH3GXN4DSUBMTVANCNFSM4UUIKAKA .

lilith commented 3 years ago

This is now fixed.

lilith commented 3 years ago

Update NativeRuntime to 1.5.4 and this should be working again.