drupal 6.10 + photos 6.x-2.6-beta3 + photos access 6.x-1.0-beta5: Images always disappear.

bog_subscribe - March 25, 2009 - 12:12
Project:photos access
Version:6.x-1.0-beta5
Component:Code
Category:bug report
Priority:critical
Assigned:Unassigned
Status:active
Description

But it's working without photos_access.

#1

waichai16 - March 30, 2009 - 16:09

I face the same problem 2.

#2

radiofranky2009 - April 7, 2009 - 19:39

I think it's a bug in the page/teaser settings. Somehow the default settings won't get registered so it doesn't know what to do(page/teaser = null). If you enable page/teaser settings for user to choose, I believe it will work.

#3

alt_pc - May 13, 2009 - 05:22

I think I may be having the same problem. When I turn on photos_access, I lose all pictures. Only the picture names remain. Page / teaser settings don't seem to help. Album Photos works ok when I disable photos_access.

Drupal 6.11
album photos 6.x-2.6-beta3
dfgallery 6.x-1.0-beta2
photos swfu 6.x-2.6-beta3
photos_access 6.x-1.0-beta5

THANKS for you help!!!

:)

#4

YAFA - June 18, 2009 - 10:31

I have the same problem. Are you running your drupal-installations with clean-URLs? If not, that's the problem.

I'm developing on MAMP, something like XAMP for Mac and I didn't switch off clean URLs. I should have, because the server, the site will run on is an IIS, that has no clean URLs and won't get the ISAPI that emulates them. On MAMP photos_access worked, on the target-server the pictures disappeared. So I compared the links to the pictures.

When photo_access is off, the pictures are simply linked by filename, like http://yourdomain.com/sites/default/files/photos/image_1/....

When photo_access is on, the pictures are linked via php. The url is something like http://yourdomain.com/photos/get/1/thumb... even if clean URLs is switched off. So the module tries to access http://yourdomain.com/index.php?q=photos/get/1/thumb... with a clean URL on a system that doesn't support it. The result is, that only the filename, as title is displayed.

The bug is: The module doesn't handle the links correctly, when clean-URLs is switched off.

#5

alt_pc - June 22, 2009 - 05:03

Hi YAFA, my Drupal installation has "Clean URLs = Enabled". Are you saying that I need to disable Clean URLS to make the Photos Access module work properly? thanks!

#6

CRAZyBUg - July 2, 2009 - 17:52

Hi,

I got this problem too.

Fixed it temporary by following:

File: /sites/all/modules/photos/photos.module row 1080

<?php
$image
['original'] = 'photos/get/'.$image['fid'] .'/original/';
?>

File: /sites/all/modules/photos/photos.module row 1082

<?php
$image
['thumb'][$thumb['name']] = 'photos/get/'.$image['fid'] .'/'.$thumb['name'].'/';
?>

File: /sites/all/modules/photos/inc/photo.images.inc row 90

<?php
function photos_image_get($fid, $thumb){
 
$file = db_fetch_array(db_query('SELECT * FROM {files} WHERE fid = %d',$fid));
 
$filename = $file['filename'];
 
$filepath = $file['filepath'];
  if (
$thumb != 'original')
  {
       
$filepath = str_replace($filename,'',$filepath);
       
$filepath = $filepath. 'thumb_'.$fid.'/'.$thumb['name'].'_'.$thumb['r'].'thumb_'.$filename;
  }

  if(!
is_file($filepath)){
    if(
$thumb != 'original' && ($thumb = _photos_get_thumbname($thumb))){
     
$str = "/thumb_{$fid}.*?thumb_/i";
     
$original = preg_replace($str, '', $filepath);
      if(
is_file( $original) && ($filepath = photos_get_thumb( $original, $fid, $thumb, 1)))
       
$true = 1;
    }
    if(!
$true){
     
drupal_set_header('Content-Type: text/plain;');
      echo
t('Image does not exist');
      exit;
    }

  }
 
header('Content-type: '.$file['filemime']);
  if (
$fd = @fopen($filepath, 'rb')) {
    while (!
feof($fd)) {
      print
fread($fd, 1024);
    }
   
fclose($fd);
    exit();
  }
 
drupal_set_header('Content-Type: text/plain;');
  echo
t('Image does not exist');
  exit;
}
?>

I have no idea about drupal, but it works for me. Tested also with private download and public download filesystem. And tested with and without clean urls. :)

 
 

Drupal is a registered trademark of Dries Buytaert.