What hash is using in Sitecore image resizing? - sitecore

I found that in release notes there is an information that since 7.5 sitecore uses hash when it renders images for security purposes:
When the feature is enabled, Sitecore automatically signs image URLs
that are rendered by the pipeline and adds a hash value to the query
string. When processing an incoming media request, image
resizing/scaling is skipped if any of the relevant query string
parameters in the image URL have been altered or any extra resizing
parameters have been appended to the URL. In these cases, Sitecore
returns the original, unaltered image.
Do you know what exactly is it hash? Is it hash of an entire url of an image or only of parameters ? What algorithms is using in this hash?

Sitecore adds hash value based on the Media.RequestProtection.SharedSecret value and list of paramters defined in protectedMediaQueryParameters setting.
Yes, it does hash the entire url of an image (from what I remember it skips the host name and selects only parameters defined in the setting mentioned above).
By default it uses SHA1 algorithm.
More information can be found in Sitecore.Media.RequestProtection.config.
You can also read Media request protection section of the Sitecore 7.5 release notes here: Release History for Sitecore 7.5 and blog post from Sean Holmesby here: Images not Resizing in Sitecore 7.5, Sitecore 8.0

Related

Customizing sso_redirect.html in wso2 IS 5.0

I'm trying to customize the sso_redirect.html page in WSO2 IS 5.0 SP1 found in location IS_HOME\repository\resources\security\sso_redirect.html.
Though any javascript or inline css changes are getting reflected in this page, any reference to images are not honored. for e.g the tag doesnt fetch the image on the page. Is there any limitation on this front?
Thanks in advance.
Cijoy
This page could be customized by defining all the resources(style sheet, images, java script, etc..) references as url instead of relative path. Then those resources may be available at the page loading time.

Media Library not listing any media items when browsed from Image Field of an item in content editor in sitecore

Media Library not listing any media items when browsed from Image Field of an item in content editor.
Steps to reproduce:
Create an item from Content Tree
Browse for an image from Image field.
Media Library UI displayed without previously uploaded images.
Expected : Media Library should display all media items available.
Note:
Inconsistency observed on multiple attempts(occasionally loads with a delay of 20 seconds - Is there any solution/fix to reduce this delay?)
Network is not an issue
User is having all the necessary roles and permissions.
Issue observed in all the browsers.
Version: Sitecore.NET 7.1 (rev. 130926)
Any help would be appreciated in knowing the root cause for Media Library not listing the media items.
Please see below attached screenshot -
Make sure your indexes have been built. The Sitecore 7.1 image UI uses the search API to display content, so if the indexes haven't been updated/build properly it will not show any data.
You can rebuild your indexes by logging into the desktop, click the Sitecore button in the bottom left, go to Control Panel and select Indexing. Click the Index Manager and follow the wizard to rebuild.
Have you specified a data source in the media field? That version of Sitecore has a known bug where such sources doesn't work. If so, ask Sitecore support for the workaround patch for this.
In Sitecore.Speak.ItemWebApi set allowanonymousaccess to true for the site name="shell"
This resolved the issue.
We have to enable the Sitecore.Speak.ContentSearch.Solr.config if using SOLR.

django sorl-thumbnail json

I am using Sorl-Thumbnail to generate thumbnails within pages via template tags.
This all works perfectly fine.
However I have now added a store locator function to the site which feeds into my Google Maps JS via JSON.
In the infowindow popups I would like to put a tiny image of the storefront.
So I need to create another size of thumbnail and I need to include the URL for this within my JSON.
It seemed initially that Sorl doesnt support this due to its requirement for Tags within a page.
I have looked at the low level API version "get_thumbnail" and have tried to implement this within my Model without much luck so far.
I have no problem with my JSON and serialisation, just getting the thumbnail generated and into the model prior to this.
Has anyone had any experience with this scenario previously?
Cheers
Kev

Sitecore - Webforms For Marketers Form - Use ReadQueryString Option

When one has added a WFFM form to a Sitecore Item, you can go to the Presentation Details and click on Form. There you'll see an option called ReadQueryString - Reads initial values from the url query string.
My form has a few fields, one of which being Email. I tried adding ?Email=test to the URL of the page that hosts this form, but the value is not being picked up. Am I correctly understanding the intended purpose of this option? Am I using it correctly?
Sitecore version 6.5; Web Forms for Marketers version 2.3
You understood the purpose correctly, when that option is checked the form's initial values are read from the querystring.
I have used this in my project and it works fine.
Make sure that you are using the field's item name in the querystring, not the displayname or title.
Also double check if you published the item after checking the ReadQueryString option.

Storing multiple images for an item in Sitecore

I want to store multiple images for an item (e.g. images of a building) and I need to create a image viewer control in the ASP.NET website as well.
What are good options to save and retrieve images from Sitecore? If there is an Image list kind of control that would be ideal in my scenario.
Is it a good option to use the "Attachment" field type? If anyone has code examples, please share.
The Sitecore Field Suite open source module contains an "Image Field" control that allows you to attach multiple images to a content item. Unlike a normal multilist, the Image List allows authors to see the images they are attaching directly in the Content Editor, which can be very helpful in choosing and arranging Carousel items.
Links:
Blog post introducting the Field Suite: http://blog.velir.com/index.php/2012/10/24/sitecore-field-suite/
FIeld Suite on Sitecore Marketplace: http://marketplace.sitecore.net/en/Modules/Field_Suite.aspx