Page 1 of 1

Image size and format info

Posted: 20 Jul 2008, 13:16
by Kirill
Jan, thank you for the great component!

Is there a way to display an information about a format of original images (XX x XX pixels) and size (in Kb, e.g.) near the images in category list layout? This information is present in "Image Download" window, but it'd be great to show it also near the images in albums or as overlib effect.

Re: Image size and format info

Posted: 20 Jul 2008, 22:05
by Jan
Hi there is no such possibility, this must be manually done in html/php...

Jan

Re: Image size and format info

Posted: 21 Jul 2008, 06:56
by Kirill
Please, could you explain what files I must edit to add this information to the images?.. :idea:

Re: Image size and format info

Posted: 22 Jul 2008, 12:57
by Kirill
Ok, I've found a solution.
To add an information about size and format of original image as overlib effect in description field:
.../components/com_phocagallery/views/category/tmpl/default.php:
search for code (~ line #137):

Code: Select all

								} else if ((int)$value->overlib == 2){
									echo " onmouseover=\"return overlib('".htmlspecialchars( addslashes($value->description))."', CAPTION, '". $value->title."', BELOW, RIGHT, FGCOLOR, '".$this->olfgcolor."', BGCOLOR, '".$this->olbgcolor."', TEXTCOLOR, '".$this->oltfcolor."', CAPCOLOR, '".$this->olcfcolor."');\"";
									echo " onmouseout=\"return nd();\" ";
and replace it onto:

Code: Select all

								} else if ((int)$value->overlib == 2){
// get original image format and size:
list($Image_width, $Image_height) = PhocaGalleryHelperFront::getImageSizePhoca($value->filename);
if (!isset($Image_width) || !isset($Image_height)) {
    $Image_width 	= 0;
    $Image_height	= 0;
}
$Image_fsize = PhocaGalleryHelperFront::getFileSizePhoca($value->filename);
if( !isset($Image_fsize) ) {
    $Image_fsize = 0;
}
echo " onmouseover=\"return overlib('".htmlspecialchars( addslashes($value->description) . "<div style=\"color:red;font-size:7pt;\">".JText::_('Image Format').": ".$Image_width." x ".$Image_height."<br />".JText::_('Image Size').": ".$Image_fsize."</div>")."', CAPTION, '". $value->title."', BELOW, RIGHT, FGCOLOR, '".$this->olfgcolor."', BGCOLOR, '".$this->olbgcolor."', TEXTCOLOR, '".$this->oltfcolor."', CAPCOLOR, '".$this->olcfcolor."');\"";
									echo " onmouseout=\"return nd();\" ";
:)

Re: Image size and format info

Posted: 22 Jul 2008, 20:30
by Jan
great...

Jan