Closed (won't fix)
Project:
Colorbox
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
4 Mar 2012 at 12:39 UTC
Updated:
3 Apr 2012 at 10:30 UTC
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 commentedOoops! We must first create derivative.
Comment #2
frjo commentedGet it added to the insert module first then I will add it to Colorbox.
Comment #3
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 commented