Skip to content

media.GetCropUrl returns ImageProcessor Querystring params and not ImageSharp Querystring params #10725

Closed
@mistyn8

Description

@mistyn8

Which exact Umbraco version are you using? For example: 8.13.1 - don't just write v8

v9-rc001

Bug summary

imagecropper setting "Square" : 560 x 560

image.GetCropUrl(cropAlias: "Square", width: 1200);

returns
/media/o24liyyr/dummy-639-200x300.jpg?center=0.8933333333333333,0.56&mode=crop&heightratio=1&width=1200&rnd=132714307686070000

that's the old imageprocessor querystrings...

imagesharp equivalent is

/media/o24liyyr/dummy-639-200x300.jpg?rxy=0.8933333333333333,0.56&rmode=crop&height=1200&width=1200&rnd=132714307686070000`

Specifics

ImageSharp.Web/Processors/ResizeWebProcessor.cs
shows the new querystring params.

Note that ratio (heightratio/widthratio) is no longer present (ratios are maintained with rmode=max/min)

Not sure if .SetRequestParser<QueryCollectionRequestParser>() could be used to remap existing imageProcessor querystring variables.. though with no ratio support it's maybe not a simple mapping?

Steps to reproduce

Create Media with crops, Add a defined Crop, and use image.GetCropUrl(...)

Expected result / actual result

crop urls would behave the same as in umbraco8.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions