Ticket

Adaptive images

Hi,

Just like to know how others should implement this in Orchard:

Every image on my website will have custom sizes available for e.g. retina, mobile etc. These should be adaptive images, so it would not be sufficient to have some resize functionality.

So what I came up with for now:

  1. Extend the ImagePart with some extra fields that points to the alternative images. So I upload one image, and then this image should have 3 alternatives.

  2. Just following a folder naming convention. So then I could add some code to the Image.cshtml that I can the same image inside the 'other folder' (e.g. ~Images/Retina or ~/Images/Large or ~Images/Mobile

Someone who thinks this can be easier or more 'solid'?

Re: Adaptive images

I'd suggest you look at media profiles.

Tuesday, March 22, 2016 3:59:57 AM bybleroy
  • bleroy
  • Lv. 08 Rookie
  • Total EXP: 527

Re: Adaptive images

I assume you mean that with the Image Profiles I can Resize and Crop images? In this case I get the images for the different resolutions from the designer(s), so I just have to point to them and not doing any manipulation during upload.

Tuesday, March 22, 2016 9:35:04 AM bykonstrui

Re: Adaptive images

You're right, if it's not automated (is this worth it?) then media profiles won't help. I'd go for a convention, to minimize any additional overhead.

Tuesday, March 22, 2016 7:40:57 PM bybleroy
  • bleroy
  • Lv. 08 Rookie
  • Total EXP: 527

Post a reply

You need to be signed in to post a reply.

Sign In