Mail Index


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

Re[2]: [ApacheGallery] help with chached files needed!



ES>> hello users@xxxxxxxxxxxxxxxx !

ES>> i have problem with chached thumbnails.
ES>> when i go to some URI within my gallery, i get thumbnails preview,
ES>> but in the server's error log i aways get errors like this
ES>> http://www.enst.ru/gallery/diving/10.2002/ - this an URL

ES>> [Thu Jun 17 12:58:58 2004] [error] [client 193.125.99.7] File does not exist:
ES>> /var/www/www.enst.ru/gallery/diving/10.2002/.cache, referer:
ES>> http://www.enst.ru/gallery/diving/10.2002/

ES>> but chached files are stored in GalleryCacheDir which is in
ES>> /tmp/Apache-Gallery
ES>> and there is directory
ES>> /tmp/Apache-Gallery/gallery/diving/10.2002/ with thumbnails, e.g.
ES>> 100x75-DSC00438.JPG (original picture is in
ES>> /var/www/www.enst.ru/gallery/diving/10.2002/DSC00438.JPG

ES>> how can i get rid of this error message?

ES> Furthermore. i created this .cache directory manually, now i get
ES> errors like this

ES> [Thu Jun 17 13:14:31 2004] [error] [client 193.125.99.7] File does not exist:
ES> /var/www/www.enst.ru/gallery/diving/10.2002/.cache/100x75-DSC00521.JPG,
ES> referer: http://www.enst.ru/gallery/diving/10.2002/

ES> so, the html code of a page refers to
ES> http://www.enst.ru/gallery/diving/10.2002/.cache/100x75-DSC00521.JPG
ES> which actually doesn't exist. this thumbnail is in /tmp directory.
ES> trying to look the source code, but i don't understand perl much, so
ES> this is hard for me to find the bug.
ES> any help would be appreciated

I found the solution for this issue.
here, starting from line 106 of Gallery.pm

if ($r->uri =~ m/\.cache\//i) {
  my $file = cache_dir($r, 0);
  $file =~ s/\.cache//;
  my $subr = $r->lookup_file($file);
  $r->content_type($subr->content_type());

  if (MP2) {
     $r->sendfile($file);
  }
  else {
     $r->path_info('');
     $r->filename($file);
  }

>>here!!  return MP2 ? Apache::DECLINED : Apache::Constants::DECLINED;

}
why there is DECLINED here? as far as i understand, cache_dir() dies
if it cannot create thumbnails. So, if there is no thumbnail and it
cannot be created, script dies with an error. I think there is no
sense in DECLINED here. I wrote Apache::OK there
and Apache::Constants::OK. Messages from apache errorlog disappeared,
now it work as expected (by me,anyway).
i suggest you make this change permanent in source code tree...

-- 
best regards
enst@xxxxxxxxxxxxxx

_______________________________________________
users mailing list
users@xxxxxxxxxxxxxxxx
http://ufo.hestdesign.com/cgi-bin/mailman/listinfo/agusers