imazen/imageflow-dotnet

White Space Trimming: ArgumentInvalid: LayoutError: ContentDependent

bwaldron opened this issue · 5 comments

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),
}

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.

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.

This is now fixed.

Update NativeRuntime to 1.5.4 and this should be working again.