November Happy Hour will be moved to Thursday December 5th.

How to add more blobs like Thumbnail

Vote:
 

Hey, I've been trying to add another dimension similar to Thumbnail and I do get it saved as blob, but the naming is wrong (it just has a new GUID).

The simplified code is the following:

img = img.CreateWritableClone() as ImageFile;
var contentIdentifier = img.BinaryDataContainer;
img.TabletImage = blobFactory.CreateBlob(contentIdentifier, ".jpg");

I would expect to have the new image named oldimage.jpg/tabletimage. How do I achieve this?

    

#81210
Feb 11, 2014 16:44
Vote:
 

You can use the ImageDescriptor attribute

  [ImageDescriptor()]

http://world.episerver.com/Blogs/Johan-Bjornfot/Dates1/2013/12/Blob-property/

#81216
Feb 11, 2014 21:29
Vote:
 

That didn't work for me, but let me try once more.

#81227
Feb 12, 2014 9:07
Vote:
 

I see now, no need to generate anything, just to decorate it with proper width and height. Thx so much!

What happens with quality, can you somehow override the default resizing behavior - ie. could you crop the image instead of scaling it?

#81228
Edited, Feb 12, 2014 9:27
Vote:
 

I've just written a blog about this very feature, and I've written a Nuget package that allows a more better ability to scale the image and handle aspect ratios. It still can't do cropping, but there is the native ImageService in EPiServer which does allow that

http://www.markeverard.com/2014/02/13/image-resizing-in-episerver-7-5-cms/

 

#81284
Feb 13, 2014 11:14
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.