How to add more blobs like Thumbnail

Member since: 2010

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
  • Member since: 2009

    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
  • Member since: 2010

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

    #81227 Feb 12, 2014 9:07
  • Member since: 2010

    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
  • Member since: 2008

    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