i.php - image Details

Hello,

When I crop an thumbnail, after done one or more are not showing in menu. I used external places for images, but this is not a problem, because photos always return ( FireBug ), but in HTML page I cannot see them.

For better fun, when I used FireBug and check <img> element they're... exists, so where is the fail of script? How can I fix that? I try with headers, imagecreatefrom... functions, nothing work.

Comments

  • acrylian Administrator, Developer
    I fear I do not really understand your problem. When are images not seen by what HTML page and in what menu they don't show up?
  • When cropping thumbnails. I think I found a problem:

    SERVERCACHE . getImageCacheFilename(filesystemToInternal($album), filesystemToInternal($image), $args)

    When I used static files evyrthink is OK, so in that line is problem. Please, check it.
  • acrylian Administrator, Developer
    Please provide some info in which context you are actually using this.
  • What do You mean? Trace all when i.php is used to create/show thumbnails. That fails sometimes and for no reason. I add a static file and when I have ~40 albums I see all thumbnails.
  • functions-image.php
    function: cacheImage

    This is the function where script looses new thumbnails...
  • acrylian Administrator, Developer
    Do you encounter this on your Zenphoto site when using a standard Zenphoto theme or when? Are you trying to precache images maybe?

    You did also mention something of external. So do you use i.php directly and when from where do you use it. Same server, different server, same site?

    If on a Zenphoto theme we have images theme and object model functions to create thumbs as well.

    This all might be important to find any possible bug.
  • It would probably help if you told us what imaging library you're using as well. (GD or Imagick)
  • GD Lubrary ( I use zenPhoto 1.2.9 ). This is the i.php showing code of images:

    `if (!$debug) {

    if(file_exists($path)) {

    header('Last-Modified: '.gmdate("D, d M Y H:i:s", $fmt).' GMT');

    $suffix = getSuffix($newfilename);

    $imageSize = filesize($path);

    switch ($suffix) {

    case 'bmp':

    $suffix = 'wbmp';

    break;

    case 'jpg':

    $suffix = 'jpeg';

    break;

    case 'png':

    case 'gif':

    case 'jpeg':

    break;

    default:

    pageError(405, gettext("Method Not Allowed"));

    exit();

    }

    $imageFunction = 'imagecreatefrom'.$suffix;

    if(function_exists($imageFunction)) {

    $imageObject = $imageFunction($path);

    if(is_resource($imageObject)) {

    $imageShowFunction = 'image'.$suffix;

    if(function_exists($imageShowFunction)) {

    header('Content-Type: image/'.$suffix);

    header('Content-Length: '.$imageSize);

    $imageShowFunction($imageObject);

    imagedestroy($imageObject);

    unset($imageFunction);

    unset($imageObject);

    unset($imageShowFunction);

    }

    }

    }

    /*if (isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) && trim($_SERVER['HTTP_IF_MODIFIED_SINCE']) == gmdate("D, d M Y H:i:s", $fmt).' GMT') {

    header('HTTP/1.0 304 Not Modified');

    header('Content-Length: 0');

    }*/

    }

    } else {

    echo "\n

    Image: image

    ";

    }`
  • acrylian Administrator, Developer
    Well, 1.2.9 is a little old. We have only resource to support the current version which is 1.3.1.2. Please install that and try with it.

    From the example: Why don't you use the object model and the existin image functions? I might not understand what you are doing why of course.
  • I used external place for photos and other data that is not in database. So, I write new classes to get information about that files, so there is no problem.

    I have a path, but I can't use Location header, because that data is hidden from people and I don't have any public domain which can saw them, so I read them as You see upper. This is OK, but why sometimes after modify thumbnails I see only URL with anchor, to better fun when I click in Firefox 'Refresh image' they're shown, so?

    Sometimes they not returned the image but only for first click, files was created, added to DB, everythink cool, but showing fail. You know why I do that?

    PS. I cannot update zenPhoto as fast as You can do. This is modify in multiple places, so updating after ~2 weeks is not fun for me, for You too, as You work as developer and You know about merging and finding differences :-)
  • acrylian Administrator, Developer
    Well you know that the image functions from Zenphoto are meant to be used with Zenphoto and optimized that way. If you use them outside Zenphoto context you might better go with the php image libary functions directly. (GD - or in current release Imagick). Unless I missundertood.
    http://php.net/manual/en/book.image.php

    PS. I cannot update zenPhoto as fast as You can do. This is modify in multiple places, so updating after ~2 weeks is not fun for me, for You too, as You work as developer and You know about merging and finding differences :-)
    Well, if you don't modify the core files - which is exactly for that reason not recommended - that is not that much of a problem normally.
Sign In or Register to comment.