Page 1 of 1

Image dimensions in <img> tag

Posted: 24 Aug 2010, 17:30
by MrAndy
Hi,

today i used the "PageSpeed" function in Firebug and it told me to specify the image dimensions correctly. Phoca Gallery plugin obviously doesn't set these parameters.

see e.g. gallery plugin demo site:

Code: Select all

<img <-- insert here height=xx width=xx --> alt="camera" src="/demo/images/phocagallery/nuovext2-icons/thumbs/phoca_thumb_m_camera.png">
Is there a simple way to change this?

Consider this post just as an hint since this is really only cosmetic and doesn't influence any functinality.

Edit: ok reading the plugin-code i realized that the plugin is trying to read it out using picasa library

Edit2: after getting enabled php5-curl and therefore also Picasa-functions it should be able to set the height and width properly, but it doesnt :-(

Edit3: for settings |type=1 or |type=2 the height and width are specified correctly in the img-tag, but for medium sized thumbnails with frame it doesn't work :-((

Re: Image dimensions in <img> tag

Posted: 28 Aug 2010, 13:22
by Jan
Hi, it is set for Picasa, because Picasa uses specified thumbnail sizes and if you are using other thumbnails size in Phoca Gallery, this needs to be corrected in img tag. In other case it is not neccessary, so if you need it then this needs to be customized in the code :-(

Jan

Re: Image dimensions in <img> tag

Posted: 28 Aug 2010, 14:28
by MrAndy
Hi Jan,

thanks for the reply and i figured out how to manage it.
Here is what i changed (in Version 2.7.2):

Replace line 1355 in plugins/content/phocagallery.php

Code: Select all

$output .= '<img src="'.JURI::base(true).'/'.$image->linkthumbnailpath.'" alt="'.$image->title.'" />';
with

Code: Select all

list($ww, $hh) = GetImageSize( $image->linkthumbnailpathabs );
$output .= '<img height="'.$hh.'" width="'.$ww.'" src="'.JURI::base(true).'/'.$image->linkthumbnailpath.'" alt="'.$image->title.'" />';

Re: Image dimensions in <img> tag

Posted: 28 Aug 2010, 15:11
by Jan
Ok