Mail Index


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ApacheGallery] Plans for a 1.0 release?



On Wed, Jan 18, 2006 at 03:47:31PM +0100, Andreas Plesner Jacobsen wrote:
> On Wed, Jan 18, 2006 at 03:33:38PM +0100, Jesus Climent wrote:
> 
> > As the subject says.
> 
> I think the plans are there, but time is lacking.
> Does anybody have any release-critical patches that have not been
> applied yet?

Apache::Gallery doesn't seem to work in Internet Explorer, nor
does navigational thumbnails seem to work. I'm running with the
attached diffset to fix these issues.

/Jesper
--- /usr/local/lib/perl5/site_perl/5.8.7/Apache/Gallery.pm.orig2	Fri Jan 20 15:19:53 2006
+++ /usr/local/lib/perl5/site_perl/5.8.7/Apache/Gallery.pm	Fri Jan 20 15:39:27 2006
@@ -508,9 +508,22 @@
 		
 		my $tpl_dir = $r->dir_config('GalleryTemplateDir');
 
+		# Check if we are rotating the picture.
+		my $rotate = readfile_getnum($r, $imageinfo, $filename.".rotate");
+		if (grep($rotate==$_, (1, 3))) {
+		    my $tmp = $image_width;
+		    $image_width = $height;
+		    $height = $tmp;
+
+		    $tmp = $orig_width;
+		    $orig_width = $orig_height;
+		    $orig_height = $tmp;
+		}
+
 		my %templates = create_templates({layout         => "$tpl_dir/layout.tpl",
 						  picture        => "$tpl_dir/showpicture.tpl",
 						  navpicture     => "$tpl_dir/navpicture.tpl",
+						  navpicture_thumb => "$tpl_dir/navpicture_thumb.tpl",
 						  info           => "$tpl_dir/info.tpl",
 						  scale          => "$tpl_dir/scale.tpl",
 						  scaleactive    => "$tpl_dir/scaleactive.tpl",
@@ -535,7 +548,11 @@
 		$tpl_vars{MENU} = generate_menu($r);
 		$tpl_vars{SRC} = uri_escape(".cache/$cached", $escape_rule);
 		$tpl_vars{URI} = $r->uri();
-	
+
+		# Fix image width and height
+		$tpl_vars{WIDTH} = $image_width;
+		$tpl_vars{HEIGHT} = $height; 
+
 		my $exif_mode = $r->dir_config('GalleryEXIFMode');
 		unless ($exif_mode) {
 			$exif_mode = 'namevalue';
@@ -571,14 +588,23 @@
 					my ($thumbnailwidth, $thumbnailheight) = get_thumbnailsize($r, $orig_width, $orig_height);	
 					my $imageinfo = get_imageinfo($r, $path.$prevpicture, $type, $orig_width, $orig_height);
 					my $cached = get_scaled_picture_name($path.$prevpicture, $thumbnailwidth, $thumbnailheight);
+					my $rotate = readfile_getnum($r, $imageinfo, $path.$prevpicture.".rotate");
 					my %nav_vars;
 					$nav_vars{URL}       = uri_escape($prevpicture, $escape_rule);
 					$nav_vars{FILENAME}  = $prevpicture;
 					$nav_vars{WIDTH}     = $width;
+					if (grep($rotate==$_, (1, 3))) {
+					    $nav_vars{T_WIDTH}   = $thumbnailheight;
+					    $nav_vars{T_HEIGHT}  = $thumbnailwidth;
+					} else {
+					    $nav_vars{T_WIDTH}   = $thumbnailwidth;
+					    $nav_vars{T_HEIGHT}  = $thumbnailheight;
+					}
 					$nav_vars{PICTURE}   = uri_escape(".cache/$cached", $escape_rule);
 					$nav_vars{DIRECTION} = "&laquo; <u>p</u>rev";
 					$nav_vars{ACCESSKEY} = "P";
 					$tpl_vars{BACK} = $templates{navpicture}->fill_in(HASH => \%nav_vars);
+					$tpl_vars{BACK_THUMB} = $templates{navpicture_thumb}->fill_in(HASH => \%nav_vars);
 				}
 				else {
 					$tpl_vars{BACK} = "&nbsp";
@@ -594,15 +620,24 @@
 					my ($thumbnailwidth, $thumbnailheight) = get_thumbnailsize($r, $orig_width, $orig_height);	
 					my $imageinfo = get_imageinfo($r, $path.$nextpicture, $type, $thumbnailwidth, $thumbnailheight);
 					my $cached = get_scaled_picture_name($path.$nextpicture, $thumbnailwidth, $thumbnailheight);
+					my $rotate = readfile_getnum($r, $imageinfo, $path.$nextpicture.".rotate");
 					my %nav_vars;
 					$nav_vars{URL}       = uri_escape($nextpicture, $escape_rule);
 					$nav_vars{FILENAME}  = $nextpicture;
 					$nav_vars{WIDTH}     = $width;
+					if (grep($rotate==$_, (1, 3))) {
+					    $nav_vars{T_WIDTH}   = $thumbnailheight;
+					    $nav_vars{T_HEIGHT}  = $thumbnailwidth;
+					} else {
+					    $nav_vars{T_WIDTH}   = $thumbnailwidth;
+					    $nav_vars{T_HEIGHT}  = $thumbnailheight;
+					}
 					$nav_vars{PICTURE}   = uri_escape(".cache/$cached", $escape_rule);
 					$nav_vars{DIRECTION} = "<u>n</u>ext &raquo;";
 					$nav_vars{ACCESSKEY} = "N";
 
 					$tpl_vars{NEXT} = $templates{navpicture}->fill_in(HASH => \%nav_vars);
+					$tpl_vars{NEXT_THUMB} = $templates{navpicture_thumb}->fill_in(HASH => \%nav_vars);
 					$tpl_vars{NEXTURL}   = uri_escape($nextpicture, $escape_rule);
 				}
 				else {

Attachment: pgpY9nVfnM1tU.pgp
Description: PGP signature