[pLog-svn] r4035 - in plog/branches/lifetype-1.1.1/class/gallery:
dao resizers
mark at devel.lifetype.net
mark at devel.lifetype.net
Sat Sep 23 20:41:57 GMT 2006
Author: mark
Date: 2006-09-23 20:41:57 +0000 (Sat, 23 Sep 2006)
New Revision: 4035
Modified:
plog/branches/lifetype-1.1.1/class/gallery/dao/galleryresources.class.php
plog/branches/lifetype-1.1.1/class/gallery/resizers/gallerythumbnailgenerator.class.php
Log:
Fixed some bugs of gallery resizer
Modified: plog/branches/lifetype-1.1.1/class/gallery/dao/galleryresources.class.php
===================================================================
--- plog/branches/lifetype-1.1.1/class/gallery/dao/galleryresources.class.php 2006-09-23 18:31:57 UTC (rev 4034)
+++ plog/branches/lifetype-1.1.1/class/gallery/dao/galleryresources.class.php 2006-09-23 20:41:57 UTC (rev 4035)
@@ -106,7 +106,7 @@
$id = $resource->getId();
$query = "SELECT id, owner_id, album_id, description,
date, flags, resource_type, file_path, file_name,
- metadata, thumbnail_format
+ metadata, thumbnail_format, properties
FROM {$prefix}gallery_resources
WHERE album_id = '$albumId' AND date >= '$date' AND id > $id
ORDER BY date ASC,id ASC LIMIT 1";
@@ -146,7 +146,7 @@
$id = $resource->getId();
$query = "SELECT id, owner_id, album_id, description,
date, flags, resource_type, file_path, file_name,
- metadata, thumbnail_format
+ metadata, thumbnail_format, properties
FROM {$prefix}gallery_resources
WHERE album_id = '$albumId' AND date <= '$date' AND id < $id
ORDER BY date DESC,id DESC LIMIT 1";
@@ -474,19 +474,19 @@
$imgWidth = $info["video"]["resolution_x"];
$imgHeight = $info["video"]["resolution_y"];
-
+
$previewHeight = $config->getValue( "thumbnail_height", GALLERY_DEFAULT_THUMBNAIL_HEIGHT );
- $previewWidth = $config->getValue( "thumbnail_width", GALLERY_DEFAULT_THUMBNAIL_WIDTH );
- $imgHeight > $previewHeight ? $previewHeight = GALLERY_DEFAULT_THUMBNAIL_HEIGHT : $previewHeight = $imgHeight;
- $imgWidth > $previewWidth ? $previewWidth = GALLERY_DEFAULT_THUMBNAIL_HEIGHT : $previewWidth = $imgWidth;
- GalleryThumbnailGenerator::generateResourceThumbnail( $resFile, $resourceId, $ownerId, $previewHeight, $previewWidth );
+ $previewWidth = $config->getValue( "thumbnail_width", GALLERY_DEFAULT_THUMBNAIL_WIDTH );
+ $thumbHeight = ( $imgHeight > $previewHeight ? $previewHeight : $imgHeight );
+ $thumbWidth = ( $imgWidth > $previewWidth ? $previewWidth : $imgWidth );
+ GalleryThumbnailGenerator::generateResourceThumbnail( $resFile, $resourceId, $ownerId, $thumbHeight, $thumbWidth );
$medPreviewHeight = $config->getValue( "medium_size_thumbnail_height", GALLERY_DEFAULT_MEDIUM_SIZE_THUMBNAIL_HEIGHT );
$medPreviewWidth = $config->getValue( "medium_size_thumbnail_width", GALLERY_DEFAULT_MEDIUM_SIZE_THUMBNAIL_WIDTH );
- $imgHeight > $medPreviewHeight ? $medPreviewHeight = GALLERY_DEFAULT_MEDIUM_SIZE_THUMBNAIL_HEIGHT : $medPreviewHeight = $imgHeight;
- $imgWidth > $medPreviewWidth ? $medPreviewWidth = GALLERY_DEFAULT_MEDIUM_SIZE_THUMBNAIL_WIDTH : $medPreviewWidth = $imgWidth;
- GalleryThumbnailGenerator::generateResourceMediumSizeThumbnail( $resFile, $resourceId, $ownerId, $medPreviewHeight, $medPreviewWidth );
-
+ $thumbHeight = ( $imgHeight > $medPreviewHeight ? $medPreviewHeight : $imgHeight );
+ $thumbWidth = ( $imgWidth > $medPreviewWidth ? $medPreviewWidth : $imgWidth );
+ GalleryThumbnailGenerator::generateResourceMediumSizeThumbnail( $resFile, $resourceId, $ownerId, $thumbHeight, $thumbWidth );
+
// call this method only if the settings are right and the image is bigger than the final size(s)
$finalPreviewHeight = $config->getValue( "final_size_thumbnail_height", 0 );
$finalPreviewWidth = $config->getValue( "final_size_thumbnail_width", 0 );
Modified: plog/branches/lifetype-1.1.1/class/gallery/resizers/gallerythumbnailgenerator.class.php
===================================================================
--- plog/branches/lifetype-1.1.1/class/gallery/resizers/gallerythumbnailgenerator.class.php 2006-09-23 18:31:57 UTC (rev 4034)
+++ plog/branches/lifetype-1.1.1/class/gallery/resizers/gallerythumbnailgenerator.class.php 2006-09-23 20:41:57 UTC (rev 4035)
@@ -14,8 +14,8 @@
* @static
*/
function generateResourceThumbnail( $resFile, $resourceId, $ownerId,
- $previewHeight = GALLERY_DEFAULT_MEDIUM_SIZE_THUMBNAIL_HEIGHT,
- $previewWidth = GALLERY_DEFAULT_MEDIUM_SIZE_THUMBNAIL_WIDTH )
+ $previewHeight = GALLERY_DEFAULT_THUMBNAIL_HEIGHT,
+ $previewWidth = GALLERY_DEFAULT_THUMBNAIL_WIDTH )
{
// get some configuration settings regarding the size of the
// thumbnails, and also the default format for thumbnails
More information about the pLog-svn
mailing list