I'm not entirly sure what you are asking, the nuget (umbraco 7.1.4 7.1.6*) was downloaded through visual studio 13, standard repo, no additional setup.
The error I'm getting is [SecurityException: Application is not configured to allow remote file downloads from this domain.], so obviously the security.config isn't loading / that part I got wrong.
Yours didn't help either I'm afraid, I guess I need to reference the security.config from my web.config somehow, but there are no references to ImageProcessor at all in my web.config. And when I try to install the nuget i get this: (It doesnt even show up in the VS Gui search)
The problem is that ImageProcessor isn't installed the right way.
There should be multiple ImageProcessor entries at different places in your web.config.
As long as those are missing, it won't work. So please try to fix your installation environment.
It might be that nuget is hiding the package because the new isn't compatible with the umbraco bundled version. I solved it using copy pasta from github repo.
Once you have installed the package you will be able to set external resources following the guidelines here.
The more specific the url, the more restrictive the filter.
I strongly recommend you read the documentation on http://docs.nuget.org/ to ensure that you are up to speed with Nuget. It's pretty much the de facto way of installing dependent software now.
It does work for images in the posts hosted on scontent.xx.fbcdn.net, but some posts include external images from another site (e.g. when linking to another site), which is hosted on external.xx.fbcdn.net
Hi, check if string contains safe_image.php.
If true, try parsing the "url" parameter from that querystring, and urldecode it. Then try to add your ImageProcessor querystring to this fixed string.
I actually had the same issue few months ago, sometimes the safe_image url parameter will include the og:image URL of a liked URL, so it's really hard to have a whitelist to maintain.
In the end, I wrote a "social media" feed importer that creates a umbraco page node and downloads the media to Umbraco. (With help of using the awesome skybrud.social)
I am also using Skybrud.Social package to get Facebook posts and Instagram media. The approach your suggested would also be my next attempt to grab the image.
Hmm, And that URL works except you need to whitelist it in security.cfg right? Hmm sorry not much help, except you might need to download and cache it on your server, then apply image handling on that.
It's a shame we can't use the FB proxy to do the scaling there instead.
If you take the standard "Picture", instead of "Full_Picture",
you get basically the same URL but with &w=130&h=130.
But it won't work to write custom dimensions ( I think one solution I tried was to do a .Replace("w=130","w=250") )
Yes, I think Facebook use the open graph image if one is defined, when users share the page.
I am not sure if you can rely on &_nc_hash is added to querystring after url, so I think it was better to split the string starting from &url= and ending before .png (or another image file type).
Using ImageProcessor for external Images(setting up config files)
Hello I want to whitelist a few domains for image processing.
According to: http://imageprocessor.org/imageprocessor-web/ I just need to add the URLs in the security.config.
However I can't find the nuget package ImageProcessor.Web.Config.
I tried creating the Security.config file manually in /config/imageprocessor/ with no luck, is this the correct syntax:?
<security allowRemoteDownloads="true" timeout="300000" maxBytes="4194304" remotePrefix="/remote.axd"> <whiteList> <add url="http://scontent-b.cdninstagram.com/" /> </whiteList> </security>
Thanks!
Hi Sean,
How did you setup nuget package ?
Thanks Alex, sorry I'm a bit noob,
I'm not entirly sure what you are asking, the nuget (umbraco 7.1.4 7.1.6*) was downloaded through visual studio 13, standard repo, no additional setup.
The error I'm getting is [SecurityException: Application is not configured to allow remote file downloads from this domain.], so obviously the security.config isn't loading / that part I got wrong.
*edit
I'm not sure if it makes any difference, but I'm using the following syntax in the security.config files (so without '/' at the end):
Btw, here it is: https://www.nuget.org/packages/ImageProcessor.Web.Config
Thanks kipusoep!
Yours didn't help either I'm afraid, I guess I need to reference the security.config from my web.config somehow, but there are no references to ImageProcessor at all in my web.config. And when I try to install the nuget i get this: (It doesnt even show up in the VS Gui search)
Btw is this the correct syntax for linking with the remote?
/remote.axd?http://scontent-b.cdninstagram.com/hphotos-xaf1/t51.2885-15/10691907_503740906436962_1302829737_s.jpg?width=130
Feels like it should have an "image" or "source" attribute, however since I get the security error and not URI error I guess thats the right way
The problem is that ImageProcessor isn't installed the right way.
There should be multiple ImageProcessor entries at different places in your web.config.
As long as those are missing, it won't work. So please try to fix your installation environment.
Sorry I jumped the gun, must had a whitespace in my search or something, ImageProcessorModule is indeed referenced in the web.config.
Do you recommend me to install it standalone instead of piggy backing on Umbracos built in?
Should I add the security.config manually in configSections, maybe thats whats missing.
Strange I can't the nuget working
Via NuGet is the way to go and fixing your NuGet problem is something you should try for yourself or ask help at the NuGet site.
Maybe something with rights permission for the file system ?
It might be that nuget is hiding the package because the new isn't compatible with the umbraco bundled version. I solved it using copy pasta from github repo.
Umbraco is bundling 3.3.3, and I used the web config from here:
https://github.com/JimBobSquarePants/ImageProcessor/blob/master/build/content/ImageProcessor.Web.Config/web.config.transform
togheter with documentation on the config files from here:
http://imageprocessor.org/imageprocessor-web/
There seems to be alot of namespace changes, at least in the processing.config, some stuff moved from .web to core and vice-versa.
Anyways, my last and final quesiton, is it safe to upgrade image processor without any umbraco conflicts, anyone with experience in this?
Thanks guys for your help!
Hi Sean,
Umbraco is bundled with the v1/v3 series of ImageProcessor and you have copied the configuration file from the v2/v4 version.
That's a major version bump so there are breaking changes in the config files. The indicator for that is the semantic versioning.
You can upgrade ImageProcessor just fine. I did it myself the other day on a 7.1.6 installation.
You should be doing it via Nuget though, it'll ensure your web.config plus other configuration files are updated for you.
Steps to check for installation via Nuget.
Installing the package itself once you have set everything up should be as simple as
For the latest and greatest version. This will install the latest ImageProcessor and ImageProcessor.Web packages
For the last v1/v3 compatible version
Once you have installed the package you will be able to set external resources following the guidelines here. The more specific the url, the more restrictive the filter.
I strongly recommend you read the documentation on http://docs.nuget.org/ to ensure that you are up to speed with Nuget. It's pretty much the de facto way of installing dependent software now.
Hopefully that clears a few thing up. :)
I am using ImageProcessor 2.5.1, ImageProcessor.Web 4.8.0 and ImageProcessor.Web.Config 2.3.0.0 and scales remote images accessed via Facebook API.
In
config/imageprocessor/security.config
I have the following:It does work for images in the posts hosted on
scontent.xx.fbcdn.net
, but some posts include external images from another site (e.g. when linking to another site), which is hosted onexternal.xx.fbcdn.net
For example:
The output will then be:
How do I handle this? and appending a querystring like
width=250&height=250&mode=crop
since it already contains a?
/Bjarne
Hi, check if string contains safe_image.php. If true, try parsing the "url" parameter from that querystring, and urldecode it. Then try to add your ImageProcessor querystring to this fixed string.
I actually had the same issue few months ago, sometimes the safe_image url parameter will include the og:image URL of a liked URL, so it's really hard to have a whitelist to maintain.
In the end, I wrote a "social media" feed importer that creates a umbraco page node and downloads the media to Umbraco. (With help of using the awesome skybrud.social)
Hi Sean
I am also using Skybrud.Social package to get Facebook posts and Instagram media. The approach your suggested would also be my next attempt to grab the image.
Now I have the following code:
/Bjarne
Hmm, And that URL works except you need to whitelist it in security.cfg right? Hmm sorry not much help, except you might need to download and cache it on your server, then apply image handling on that.
It's a shame we can't use the FB proxy to do the scaling there instead. If you take the standard "Picture", instead of "Full_Picture", you get basically the same URL but with &w=130&h=130.
But it won't work to write custom dimensions ( I think one solution I tried was to do a .Replace("w=130","w=250") )
No, I only have these in whitelist:
in the "else if" it extract the image url, e.g.
This is stored is
fullPictureRefUrl
and it trim the protocol.Then it use ImageProcessor to resize and crop the image:
For now it only handle
.png
, but I can probably use a regex to looking for other images extensions aswell.Ahh I See!
My /feed looks more like this:
So the problem in my case is it's using the og:image. For example when the user/page shares a website.
You could check for
&_nc_hash
instead of .png maybe?Yes, I think Facebook use the open graph image if one is defined, when users share the page.
I am not sure if you can rely on
&_nc_hash
is added to querystring afterurl
, so I think it was better to split the string starting from&url=
and ending before.png
(or another image file type).is working on a reply...