-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
V8 .GetCropUrl("CropAlias") generates invalid ImageProcessor URL #8116
Comments
Hi @hfloyd 🙂 Thanks for reporting. That doesn't sound too good. Strange it's not been reported sooner...! I'll dig into it and see what I can come up with 👍 |
@hfloyd for the life of me I can't reproduce this... I have an image with some crops defined:
I have also tried applying your parameters ( |
Hmm… Well, this is a migrated site (7 to 8), so perhaps something is slightly different with the data stored for crops? I don’t know. Or some weird caching thing?
I appreciate you looking into it, Kenn.
|
Hi again, Heather. I would be surprised if this was a migration or caching issue. Like I said, the URL parameters you originally posted work just fine on my V8 site. Of course you can try creating a new image with a crop and see what output Question is if something weird is going on in your project? Something that prevents ImageProcessor from working properly? |
Well, this is a migration, so there is likely plenty of "weird" stuff... but, if I use the width/height version of |
Hmm. Could you post a few more invalid/broken image crop URLs? Maybe I can manage to make one of them fail on a local install. |
I can reproduce now, when I put an image cropper directly on a content item (so it's not a media picker) then something like
Doesn't give the correct result. After looking in the docs, I got here: https://our.umbraco.com/documentation/getting-started/backoffice/property-editors/built-in-property-editors/image-cropper/#mvc-view-example-to-output-a-banner-crop-from-a-cropper-property-with-the-alias-image The preferred new way in v8 is apparently to use the
This doesn't work because we need to give an
So: from the So, a few things here:
|
We'd love some help with this, luckily there's a workaround for now! |
Hi @hfloyd, We're writing to let you know that we would love some help with this issue. We feel that this issue is ideal to flag for a community member to work on it. Once flagged here, folk looking for issues to work on will know to look at yours. Of course, please feel free work on this yourself ;-). If there are any changes to this status, we'll be sure to let you know. For more information about issues and states, have a look at this blog post Thanks muchly, from your friendly Umbraco GitHub bot :-) |
Changing this functionality from returning just the querystring portion of the URL as opposed to the full image url would be deemed a breaking change and with this already marked as obsolete and the documentation suggesting to use the newer approach with the UrlHelper approach. Before (obsolete)Model.FeaturedImage = After (With new UrlHelper)Model.FeaturedImage = I will close this issue, if we need to relook at this then please re-open this with more details |
Thanks, @nul800sebastiaan and @warrenbuckley . It looks like the documentation is now matching what Warren suggested, so I guess all is well. :-) |
In the process of migrating a v7 website to v8 I came across an issue with "GetCropUrl()"
This code was not providing a cropped/resized image:
featuredPost.BlogPostThumbnail.GetCropUrl("blogThumbnail")
but when I changed it to this:
featuredPost.BlogPostThumbnail.GetCropUrl(610,329)
it worked.
Checking the generated image src urls...
featuredPost.BlogPostThumbnail.GetCropUrl("blogThumbnail")
generates:
/media/4395/shutterstock_256320622_girl-with-tree.jpg?center=0.46832782948063639,0.58439388147611493&mode=crop&width=610&height=329&rnd=132339387248830000
but
featuredPost.BlogPostThumbnail.GetCropUrl("blogThumbnail")
generates:
/media/4395/shutterstock_256320622_girl-with-tree.jpg?crop=0,0.093333333333333338,0,0.097650273224043641&cropmode=percentage&width=610&height=329&rnd=132339387248830000
It seems that those parameters aren't valid for ImageProcessor. If I edit the url in the HTML via Dev console in the browser, and remove "&width=610&height=329" - the image displays properly.
So, perhaps this is a bug in the v8 implementation of .GetCropUrl(ALIAS)...?
This item has been added to our backlog AB#9962
The text was updated successfully, but these errors were encountered: