Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 24
  1. #11
    Join Date
    Mar 2006
    Location
    Belarus
    Posts
    72
    Plugin Contributions
    0

    Default Re: Small, medium, large versions of product images--I've gotten mixed messages

    Thanks, but this doesn't work either. I've renamed to _1 .. _5, and numbers _1, _2 and _5 show, but _3 and _4 doesn't. Weird situation...
    May be someone know which exactly module is responsible for collecting additional images? I've installed many mods, so one of them causes error, probably.

  2. #12
    Join Date
    Mar 2006
    Location
    Belarus
    Posts
    72
    Plugin Contributions
    0

    Default Re: Small, medium, large versions of product images--I've gotten mixed messages

    Hm. More and more strange... It seems that Zen code itself works fine. When I've inserted 'echo $file' line into additional_images.php script where it reads out an image dir, it listed me about 1200 files instead of actual 1800+. As expected, there are _1, _2 and _5 in the list, but no _3 and _4. So, does this mean that I have problem with my hosting provider? Will search about this dir problem on the Internet meantime...

  3. #13
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Small, medium, large versions of product images--I've gotten mixed messages

    I thought it only looked for _01, _02, _03 etc at the end of filenames.
    No, additional image filenames are not limited in any way to numbers. The one requirement (beside unique basenames) is that, when images are stored in subfolders like /images/mcl/, you must use an underscore _ to separate the basename and additional names. You have done this, so I don't see any impediment to proper function. I don't know why it wouldn't be working for you.

  4. #14
    Join Date
    Mar 2006
    Location
    Belarus
    Posts
    72
    Plugin Contributions
    0

    Default Re: Small, medium, large versions of product images--I've gotten mixed messages

    Solved!
    For some reason
    while ($file = $dir->read()) {
    on the line 43 of additional_images.php soen't work.
    It should be modified to while (($file = $dir->read()) !== false) {

    I never reported bugs, so I don't know how to report it correctly, but I hope that developers read this post and take a look to decide if this is really worth correction. Works like a charm for me.

  5. #15
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Small, medium, large versions of product images--I've gotten mixed messages

    The original code is functionally equivalent to

    while (($file = $dir->read()) != false) {

    so for some reason apparently you are experiencing $dir->read() evaluating to 0 or null unexpectedly, which is handled as "false". Your addition requires it to be explicitly "false", solving your problem.
    It cannot be a common problem, though, or thousands of people would have experienced and presumably reported it. Could there be anything at all non-standard about how your site handles images?

  6. #16
    Join Date
    Mar 2006
    Location
    Belarus
    Posts
    72
    Plugin Contributions
    0

    Default Re: Small, medium, large versions of product images--I've gotten mixed messages

    I've found the answer. Here is what is written on http://www.php.net/manual/en/function.dir.php:
    "Please note the fashion in which Directory::read()'s return value is checked in the example below. We are explicitly testing whether the return value is identical to (equal to and of the same type as - see Comparison Operators for more information) FALSE since otherwise, any directory entry whose name evaluates to FALSE will stop the loop. "

    Exactly my case since I had '0' subfolder in the 'mcl' folder. So, the loop stopped after it got to read the '0' folder entry from the directory instance.
    So, I'm sure that Zen code needs to be fixed now to prevent such rare (but possible, as you can see) cases.
    Last edited by rafcamera; 7 Feb 2012 at 09:08 PM.

  7. #17
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Small, medium, large versions of product images--I've gotten mixed messages

    I see the main image:
    /images/mcl/ob-oks5-18-1.jpg

    I see the additional images:
    /images/mcl/ob-oks5-18-1_all.jpg
    /images/mcl/ob-oks5-18-1_fron.jpg
    /images/mcl/ob-oks5-18-1_front.jpg
    /images/mcl/ob-oks5-18-1_rear.jpg
    /images/mcl/ob-oks5-18-1_side.jpg

    Which one is missing?
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  8. #18
    Join Date
    Mar 2006
    Location
    Belarus
    Posts
    72
    Plugin Contributions
    0

    Default Re: Small, medium, large versions of product images--I've gotten mixed messages

    Damn... There are 50 files in the Zen 1.5 distributive with directory handling. I suppose that each and every of them should be fixed. Will do this to my copy tomorrow.

    Ajeh, nothing is missing now since I've fixed code checking return value of directory read for additional images. But there are 49 more php files that make wrong checks in other cases, and they need to be fixed as well to prevent problems if files or folders whose names evaluate to FALSE will be created somewhere (template '0', for example).
    Last edited by rafcamera; 7 Feb 2012 at 09:20 PM.

  9. #19
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Small, medium, large versions of product images--I've gotten mixed messages

    I had '0' subfolder in the 'mcl' folder.
    This is critical information which you didn't tell us. Is this /0/ subfolder needed with that name?

    Linda - the file edit in post #14 solved the problem, so all images now display. It is still puzzling because I would think the /mcl/ folder's content would be looked at sequentially and either all of one product's files would be processed before the 0 broke it, or the 0 would be processed first and you would not see any additional images. Maybe you can shed some light on MySQL/PHP processing in this area?

  10. #20
    Join Date
    Mar 2006
    Location
    Belarus
    Posts
    72
    Plugin Contributions
    0

    Default Re: Small, medium, large versions of product images--I've gotten mixed messages

    Quote Originally Posted by gjh42 View Post
    This is critical information which you didn't tell us. Is this /0/ subfolder needed with that name?
    How did I know that this is critical? I'm not a php pro. Just learning by experience. No need for such name for that folder (I just used to give simple names to temporary or 'to-process' folders - '0' puts it into beginning of the list to not forget about it).

    Maybe you can shed some light on MySQL/PHP processing in this area?
    I've read about this issue few hours ago. Directory reads not in alphabetical order. It is rather equivalent to 'unsorted' form of the list, with folders scattered in midst of files. I didn't notice that problem until I created '0' folder few months ago. And I've noticed first problems today only (though they appeared long ago, most probably, since it is impossible to tell how OS arranges files and folders in FAT or whatever linux uses).

 

 
Page 2 of 3 FirstFirst 123 LastLast

Similar Threads

  1. v151 Zen image preparation 3 (small, medium, large) images folder?
    By gsmsalers in forum General Questions
    Replies: 4
    Last Post: 4 Oct 2013, 05:01 PM
  2. Medium and large images show small
    By line1 in forum General Questions
    Replies: 8
    Last Post: 28 Sep 2012, 05:13 PM
  3. Product images setup Small-Medium-large?
    By hara in forum General Questions
    Replies: 8
    Last Post: 9 Oct 2008, 06:55 AM
  4. Small, Medium, Large Images in New Folder
    By monkeytastic in forum General Questions
    Replies: 1
    Last Post: 7 Mar 2008, 01:24 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR