Misuses of image sizes and spaces in file names issue

yakuza-fs - November 16, 2008 - 18:16
Project:Fotonotes
Version:6.x-1.1-beta1
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active
Description

I have installed Fotonotes into my intranet site. I am able to add/edit fotonotes but there are a couple of issues displaying my images using bb code [inote=%image_nid%] (both concerns fotonotes_bbcode function).

So, the first issue is that Fotonotes uses preview size of an image to add/edit notes but further replaces [inote] with _original size (it leads to invalid dimensions for notes), to fix this I have replaced

$r = db_fetch_object(db_query("SELECT f.filepath FROM {image} i INNER JOIN {files} f ON f.fid = i.fid WHERE i.image_size = '_original' AND i.nid = %d", $nid));

with

$r = db_fetch_object(db_query("SELECT f.filepath FROM {image} i INNER JOIN {files} f ON f.fid = i.fid WHERE i.image_size = 'preview' AND i.nid = %d", $nid));

It uses "preview" size of an image for add/edit and preview image with fotonotes.

The second issue goes with spaces in image filename. The fix is also a simple one, just replace the

$x = "<img src=" . base_path() . $r->filepath . " class=fn-image id=inote" . $nid . ">";

with

$x = "<img src='" . base_path() . $r->filepath . "' class=fn-image id=inote" . $nid . ">";

I hope this was helpful.

This module rocks! Thanks

 
 

Drupal is a registered trademark of Dries Buytaert.