Image 5.x-2.0-alpha3
Image assist 5.x-2.x-dev
Lightbox2 5.x-2.x-dev

I am using image assist to insert images with the wysiwyg editor.
The settings on image node settings appear to work fine for the original image presets, "Original, Thumbnail, & Preview".
Custom Presets work oddly, either not being handled or linking to themselves in lightbox and not the Lightbox image display size.
The settings for Image Assist images do not seem to have any affect.

It also would be nice, to have additional settings for display size, based on the trigger.

CommentFileSizeAuthor
#7 303780_img_assist_custom_sizes.patch867 bytesfenstrat
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dman’s picture

IIRC, lightbox does some guesswork - clientside - to calculate the desired filename based on the trigger link or filename.
Basically swapping blah/mypic.thumbnail.jpg into blah/mypic.preview.jpg - although the configs try to pass the appropriate logic through to the js.

How are your presets named, and what does the failing view-source trigger look like (paste the HTML in [code] tags) and let us know what it SHOULD be requesting.

sgriffin’s picture

Oddly enough the custom preset is now working. After removing it, adding it back and selecting it again.

Custom sizes, do not display however.
Image Assist custom size handler is set to lightbox grouped

Not working.
Only local images are allowed.

If I set the class in custom classes, lightbox activates, but with no target.
Only local images are allowed.

The custom preset is working as
View Image Details]'>Only local images are allowed.

sgriffin’s picture

Oddly enough the custom preset is now working. After removing it, adding it back and selecting it again.

Custom sizes, do not display however.
Image Assist custom size handler is set to lightbox grouped

Not working.

<a href="/panamamio/content/sobre-las-nubes"><img height="50" width="75" class="image image-img_assist_custom-75x50" title="Sobre las Nubes" alt="Sobre las Nubes" src="http://southern-digital.com/panamamio/system/files/images/photo004.img_assist_custom-75x50.jpg"/></a>

If I set the class in custom classes, lightbox activates, but with no target.
<a href="/panamamio/content/sobre-las-nubes" rel="lightbox[image image-img_assist_custom-75x50][Sobre las Nubes]"><img height="50" width="75" class="image image-img_assist_custom-75x50" title="Sobre las Nubes" alt="Sobre las Nubes" src="http://southern-digital.com/panamamio/system/files/images/photo004.img_assist_custom-75x50.jpg"/></a>

The custom preset is working as 
<a href="http://southern-digital.com/panamamio/system/files/images/photo004.preview.jpg" rel='lightbox[node_images][Sobre las Nubes<br /><a href="/panamamio/content/sobre-las-nubes" id="node_link_text"  >View Image Details</a>]'><img height="33" width="50" class="image image-mini" title="Sobre las Nubes" alt="Sobre las Nubes" src="http://southern-digital.com/panamamio/system/files/images/photo004.mini.jpg"/></a>
stella’s picture

I think this is because the class name on the image is image-img_assist_custom-75x50 instead of the normal image-img_assist_custom. Did you do something to change the default class name? This also appears in the filename, which is why it's not working.

Cheers,
Stella

stella’s picture

It's actually an issue caused by the 5.x-2.x-dev version of img_assist. I've opened an issue on it here: #303945: Add consistent CSS class name for custom sized images I'll need that issue first before lightbox2 will work.

Cheers,
Stella

Robbert’s picture

After having fixed the classname issue in img_assist it seems to work, but there are two issues:

  • Both the img_assist popup and Lightbox are opened instead of just Lightbox. I think you should unset onclick of the anchor somewhere in auto_image_handling.js.
  • The href rewriting in auto_image_handling.js is resulting in a wrong url, and hence no image is displayed in Lightbox.
fenstrat’s picture

Version: 5.x-2.x-dev » 6.x-1.x-dev
Status: Active » Needs review
FileSize
867 bytes

I'm not sure about the 5.x-2.x version but this is also effecting the 6.x-1.x version so moving there. Also this depends on #303945: Add consistent CSS class name for custom sized images which is a 6.x issue.

Attached is a fix for auto_image_handling.js not correctly rewritting the src tag.

Basically img_assist creates img src files for custom images in the format image-name.img_assist_custom-150x100.jpg where 150 is the width and 100 is the height of the custom image. When auto_image_handling.js rewrites the src tag it doesn't take account of the "-widthxheight". The patch adds this to the regex.

Note: this patch also depends on img_assist outputting consistent classes to custom sized images as per #303945-21: Add consistent CSS class name for custom sized images

#6 point 1: I can't replicate that, when does it show up?

Sunil Mohan’s picture

When both patches are applied, everything works fine for me except "Download Original" is linked to "http://example.com/content/null".

stella’s picture

Status: Needs review » Fixed
fenstrat’s picture

Thanks stella!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.