Image dimensions in <img> tag

Phoca Gallery plugins - plugins for Phoca Gallery extension
MrAndy
Phoca Newbie
Phoca Newbie
Posts: 4
Joined: 21 Jul 2009, 21:52

Image dimensions in <img> tag

Post 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 :-((
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48403
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Image dimensions in <img> tag

Post 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
If you find Phoca extensions useful, please support the project
MrAndy
Phoca Newbie
Phoca Newbie
Posts: 4
Joined: 21 Jul 2009, 21:52

Re: Image dimensions in <img> tag

Post 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.'" />';
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48403
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Image dimensions in <img> tag

Post by Jan »

Ok
If you find Phoca extensions useful, please support the project
Post Reply