0

Can anyone tell me if there is a way to define multiple image sizes and create those images sizes each time an original image is uploaded?

I've been using imagecache but unless I'm wrong, it doesn't help when you want to create multiple images of various sizes when an original is uploaded.

Can anyone help?

  • which version of Drupal? – quickcel Mar 21 '14 at 14:00
0

You are using imagecache. Here you can create different type of image styles. And you can use below code for display multiple images of various sizes of an original uploaded image.

 $style = 'thumbnail_200_by_200';
 $image_uri = 'public://image_name.jpg';
 $img_url = image_style_url($style, $image_uri);

 <img src="<?php echo $img_url;?>"/>
0

For drupal 7: Create the image styles in Admin > Configuraion > Media > image styles. Next, in the display settings for your content type, select which image fields to display, and which image style to display them in, for that display.

For drupal 6, the procedure is practically identical, except that you'll need the imagecache module to be installed and enabled. Instead of going to media > image styles, you'll have to create "imagecache presets" in the imagecache module settings.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.