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

InternalError: NodeParamsMismatch: Need Crop, got None at #47

Closed rrs closed 9 months ago

rrs commented 1 year ago

Hi,

the following code throws and exception

using var b = new ImageJob();

var node = b.Decode(imageBytes);

node.CropWhitespace(80, 5);

var r = await node.EncodeToStream(stream, false, new MozJpegEncoder(quality ?? 100, true))
            .Finish().InProcessAsync();

the exception

InternalError: NodeParamsMismatch: Need Crop, got None at
imageflow_core\src\flow\nodes\clone_crop_fill_expand.rs:416:17
https://github.com/imazen/imageflow/blob/70945c00267a99d678fb0d53e675dc7827e12fe2/imageflow_core/src/flow/nodes/clone_crop_fill_expand.rs#L416
imageflow_core\src\flow\nodes\clone_crop_fill_expand.rs:436:58
https://github.com/imazen/imageflow/blob/70945c00267a99d678fb0d53e675dc7827e12fe2/imageflow_core/src/flow/nodes/clone_crop_fill_expand.rs#L436
imageflow_core\src\flow\execution_engine.rs:294:29
https://github.com/imazen/imageflow/blob/70945c00267a99d678fb0d53e675dc7827e12fe2/imageflow_core/src/flow/execution_engine.rs#L294
imageflow_core\src\context.rs:419:59
https://github.com/imazen/imageflow/blob/70945c00267a99d678fb0d53e675dc7827e12fe2/imageflow_core/src/context.rs#L419
imageflow_core\src\context_methods.rs:50:68
https://github.com/imazen/imageflow/blob/70945c00267a99d678fb0d53e675dc7827e12fe2/imageflow_core/src/context_methods.rs#L50
Active node:
NodeDebugInfo {
    stable_id: 4,
    params: None,
    index: NodeIndex(3),
}

Is this expected?

lilith commented 1 year ago

Try

node = node.CropWhitespace(80, 5);

On Thu, May 4, 2023, 5:04 AM Robert Snipe @.***> wrote:

Hi,

the following code throws and exception

using var b = new ImageJob();

var node = b.Decode(imageBytes);

node.CropWhitespace(80, 5);

var r = await node.EncodeToStream(stream, false, new MozJpegEncoder(quality ?? 100, true)) .Finish().InProcessAsync();

the exception

InternalError: NodeParamsMismatch: Need Crop, got None at imageflow_core\src\flow\nodes\clone_crop_fill_expand.rs:416:17https://github.com/imazen/imageflow/blob/70945c00267a99d678fb0d53e675dc7827e12fe2/imageflow_core/src/flow/nodes/clone_crop_fill_expand.rs#L416 imageflow_core\src\flow\nodes\clone_crop_fill_expand.rs:436:58https://github.com/imazen/imageflow/blob/70945c00267a99d678fb0d53e675dc7827e12fe2/imageflow_core/src/flow/nodes/clone_crop_fill_expand.rs#L436 imageflow_core\src\flow\execution_engine.rs:294:29https://github.com/imazen/imageflow/blob/70945c00267a99d678fb0d53e675dc7827e12fe2/imageflow_core/src/flow/execution_engine.rs#L294 imageflow_core\src\context.rs:419:59https://github.com/imazen/imageflow/blob/70945c00267a99d678fb0d53e675dc7827e12fe2/imageflow_core/src/context.rs#L419 imageflow_core\src\context_methods.rs:50:68https://github.com/imazen/imageflow/blob/70945c00267a99d678fb0d53e675dc7827e12fe2/imageflow_core/src/context_methods.rs#L50 Active node: NodeDebugInfo { stable_id: 4, params: None, index: NodeIndex(3), }

Is this expected?

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

rrs commented 1 year ago

Ah silly me!

Thank you