Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Hello,
I use image_caption module and it needs width attribute.
Please add these lines into template_preprocess_colorbox_insert_image()
$image_style_path = image_style_path($vars['item']['style_name'], $file->uri);
$image_info = image_get_info($image_style_path);
$variables['width'] = isset($image_info['width']) ? $image_info['width'] : '';
$variables['height'] = isset($image_info['height']) ? $image_info['height'] : '';
and update colorbox-insert-image.tpl.php
Thanks
Comments
Comment #1
joglin CreditAttribution: joglin commentedOoops! We must first create derivative.
Comment #2
frjo CreditAttribution: frjo commentedGet it added to the insert module first then I will add it to Colorbox.
Comment #3
joglin CreditAttribution: joglin commentedI read this discussion: Calculate width and height attributes when inserting ImageCache images and I realized that this feature is more complicated than I thought. Only a very specific filter solves complexity of this issue and Image Resize Filter is good for me, actually.
Thanks.
Comment #4
frjo CreditAttribution: frjo commented