You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 26, 2022. It is now read-only.
Repository navigation
This repository was archived by the owner on Feb 26, 2022. It is now read-only.
ImagePoint with URL from label doesn't load image #11
Not sure if I'm doing this wrong here, but I need to use a specific CropUp crop with the ImagePoint datatype, so I have a Media.BeforeSave event on my Image media type that updates a label property on the Image with the specific CropUp crop's URL.
I've then set the ImagePoint data type to use the label property instead of the standard umbracoFile property - but then the ImagePoint editor no longer shows an image (works fine - just no image since the src attribute is blank on the <img> tag).
I've double-checked that the URL stored on the label is in fact a URL for an image (though it's obviously fetched using CropUp's HTTPHandler - hmmm... could that be it? It's just the original URL prefixed with "/CropUp/somealias").
Upon even further inspection (just tell me to stop already ;) it seems the path from Server.MapPath() is only used to determine if a file exists (line 279) in that location (and to get the .Size, I guess) while the actual fetching of the image seems to use the original URL from the property...
Hi Chriztian, yes it loads in the image to get the size so that it can scale accordingly - we might be able to skip this if we specify the size in the ImagePoint configuration ? (or maybe it's possible to cheat and use your custom Media.BeforeSave event to save a physical file ?)
After some more testing and using it, I think the best option for setting this data type up is to always use the property where the original image is stored (which is almost always umbracoFile) - it makes the most sense to add points to the full image, regardless if you're using crops and not to actually displaying the full image.
But I would suggest that the data type saves a local version of the image in the dimensions it's using, so it's possible to use large images without the browser having to scale it down...
Activity
greystate commentedon Mar 26, 2014
Just had a look at the source ("Oh no"! :) - and I suspect this line is the problem:
Server.MapPath()returns a local (physical) file path, right? So I can't use CropUp's "pretty" URLs (or any other "processed" images), it seems...greystate commentedon Mar 27, 2014
Upon even further inspection (just tell me to stop already ;) it seems the path from
Server.MapPath()is only used to determine if a file exists (line 279) in that location (and to get the.Size, I guess) while the actual fetching of the image seems to use the original URL from the property...Hendy commentedon Mar 27, 2014
Hi Chriztian, yes it loads in the image to get the size so that it can scale accordingly - we might be able to skip this if we specify the size in the ImagePoint configuration ? (or maybe it's possible to cheat and use your custom Media.BeforeSave event to save a physical file ?)
greystate commentedon Apr 1, 2014
After some more testing and using it, I think the best option for setting this data type up is to always use the property where the original image is stored (which is almost always
umbracoFile) - it makes the most sense to add points to the full image, regardless if you're using crops and not to actually displaying the full image.But I would suggest that the data type saves a local version of the image in the dimensions it's using, so it's possible to use large images without the browser having to scale it down...