Missing images

135 views
Skip to first unread message

Jon Schewe

unread,
Feb 26, 2023, 4:27:32 PM2/26/23
to gallery...@googlegroups.com
Today I went into my gallery and I have an album that has permissions so that only I can view it. I logged in and went to the album and all of the images are missing. There are boxes where the images should be with the filenames, but no images. When I click on one of the images to get the full sized one I get pointed the the log file below. I checked the filesystem and the images are there and readable. I tried running the maintenance tasks and still nothing. No errors show up in my apache logs either. Anyone have any suggestions?

<?php defined('SYSPATH') or die('No direct script access.'); ?>

2023-02-26 21:12:06 +00:00 --- error: File not found: lib%2Fimages%2Ffavicon.ico
2023-02-26 21:12:15 +00:00 --- error: File not found: file_proxy%2F.album.jpg
2023-02-26 21:12:23 +00:00 --- error: File not found: file_proxy%2F.album.jpg
2023-02-26 21:12:27 +00:00 --- error: File not found: jpschewe%2Flib%2Fimages%2Ffavicon.ico
2023-02-26 21:12:36 +00:00 --- error: File not found: file_proxy%2F.album.jpg
2023-02-26 21:12:38 +00:00 --- error: File not found: file_proxy%2F.album.jpg
2023-02-26 21:12:38 +00:00 --- error: File not found: file_proxy%2F2-23-2014%2F.album.jpg
2023-02-26 21:12:38 +00:00 --- error: File not found: file_proxy%2F11-27-2014%2F.album.jpg
2023-02-26 21:12:38 +00:00 --- error: File not found: file_proxy%2FLaptop-2013%2F.album.jpg
2023-02-26 21:12:38 +00:00 --- error: File not found: file_proxy%2F9-15-2015---Kayaks%2F.album.jpg
2023-02-26 21:12:38 +00:00 --- error: File not found: file_proxy%2F3-31-2016%2F.album.jpg
2023-02-26 21:12:38 +00:00 --- error: File not found: file_proxy%2F4-10-2017%2F.album.jpg
2023-02-26 21:12:38 +00:00 --- error: File not found: file_proxy%2F12-26-2017%2F.album.jpg
2023-02-26 21:12:38 +00:00 --- error: File not found: file_proxy%2F4-26-2019%2F.album.jpg
2023-02-26 21:12:40 +00:00 --- error: File not found: file_proxy%2F.album.jpg
2023-02-26 21:12:40 +00:00 --- error: File not found: file_proxy%2F2-23-2014%2F.album.jpg
2023-02-26 21:12:40 +00:00 --- error: File not found: file_proxy%2F9-15-2015---Kayaks%2F.album.jpg
2023-02-26 21:12:40 +00:00 --- error: File not found: file_proxy%2FLaptop-2013%2F.album.jpg
2023-02-26 21:12:40 +00:00 --- error: File not found: file_proxy%2F11-27-2014%2F.album.jpg
2023-02-26 21:12:40 +00:00 --- error: File not found: file_proxy%2F3-31-2016%2F.album.jpg
2023-02-26 21:12:40 +00:00 --- error: File not found: file_proxy%2F4-10-2017%2F.album.jpg
2023-02-26 21:12:40 +00:00 --- error: File not found: file_proxy%2F12-26-2017%2F.album.jpg
2023-02-26 21:12:40 +00:00 --- error: File not found: file_proxy%2F4-26-2019%2F.album.jpg
2023-02-26 21:12:41 +00:00 --- error: File not found: file_proxy%2Fpict0006.jpg
2023-02-26 21:12:41 +00:00 --- error: File not found: file_proxy%2Fpict0014.jpg
2023-02-26 21:12:41 +00:00 --- error: File not found: file_proxy%2Fpict0015.jpg
2023-02-26 21:12:41 +00:00 --- error: File not found: file_proxy%2Fpict0007.jpg
2023-02-26 21:12:42 +00:00 --- error: File not found: jpschewe%2Fsecurity%2Flib%2Fimages%2Ffavicon.ico
2023-02-26 21:12:43 +00:00 --- error: File not found: file_proxy%2Fpict0006.jpg
2023-02-26 21:12:43 +00:00 --- error: File not found: file_proxy%2Fpict0007.jpg
2023-02-26 21:12:43 +00:00 --- error: File not found: jpschewe%2Fsecurity%2Fsecurity-2008-09-29%2Flib%2Fimages%2Ffavicon.ico
2023-02-26 21:12:44 +00:00 --- error: File not found: file_proxy%2Fpict0006.jpg
2023-02-26 21:12:44 +00:00 --- error: File not found: file_proxy%2Fpict0007.jpg
2023-02-26 21:12:48 +00:00 --- error: File not found: file_proxy%2Fpict0006.jpg
2023-02-26 21:12:48 +00:00 --- error: File not found: file_proxy%2Fpict0007.jpg
2023-02-26 21:12:48 +00:00 --- error: File not found: jpschewe%2Fsecurity%2Fsecurity-2008-09-29%2Flib%2Fimages%2Ffavicon.ico
2023-02-26 21:12:50 +00:00 --- error: File not found: file_proxy%2Fpict0006.jpg
2023-02-26 21:13:22 +00:00 --- error: File not found: file_proxy%2Fpict0006.jpg
2023-02-26 21:13:22 +00:00 --- error: File not found: file_proxy%2Fpict0007.jpg
2023-02-26 21:13:24 +00:00 --- error: File not found: file_proxy%2Fpict0006.jpg

J.R.

unread,
Feb 26, 2023, 5:20:44 PM2/26/23
to gallery...@googlegroups.com
John,

You may have already tried this, but: Login, navigate to the top page of  problem album click the "Album options" option at the top of the album page and then click "Change permissions" and set the access check marks for that album back to the exact same settings you are using for all the other albums (which are still visible I presume?).  It's possible that somehow making the album private to you scrambled something... maybe a glitch in the change permissions script?

-- J.R.
--
WHEN USING AN EMAIL PROGRAM to reply to this message, click REPLY TO LIST or REPLY TO ALL so your reply goes out to everyone in the group. If you click REPLY or REPLY TO SENDER Google will *only* send your reply to the original author (not recommended).
 
To post a NEW MESSAGE to the group, send an new email to:
gallery...@googlegroups.com
 
To view or sign in to this group on the web, use this URL:
https://groups.google.com/forum/#!forum/gallery-3-users
---
You received this message because you are subscribed to the Google Groups "Gallery 3 Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gallery-3-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gallery-3-users/c6b240c611b61b958bfc862326254bd1ea84a635.camel%40mtu.net.

Jon Schewe

unread,
Feb 26, 2023, 5:42:24 PM2/26/23
to gallery...@googlegroups.com
Note that the album has been private for 5+ years. I haven't changed it recently. The only thing that I can think of is that I ran the maintenance tasks a few weeks ago. Maybe that broke something?
I changed the permissions to be open and now I can see the images. I changed them back to limited and the images went away. Sounds like something is broken in the change permissions script. Where would I start looking for the code that handles this? 

Here's my version information:
Version: 3.0+ (branch master, build 434) 

Info.RockEdge

unread,
Feb 26, 2023, 5:59:39 PM2/26/23
to gallery...@googlegroups.com

Has the PHP version on the server changed?

Jon Schewe

unread,
Feb 26, 2023, 11:05:22 PM2/26/23
to gallery...@googlegroups.com
Probably as updates have been applied. The server is currently at 7.4.3-4ubuntu2.17

J.R.

unread,
Feb 28, 2023, 4:28:45 PM2/28/23
to gallery...@googlegroups.com
John,

I've never heard of dong a full maintenance run breaking anything -- it's intended to fix things that might have some how "broke" else where in the Gallery system/database. Since changing the settings back to public access made the images visible again it's got to be something in the permission script or a PHP conflict (permissions are a critical security element in all versions of PHP). But first:

You indicated that you may still be running Gallery ver. 3.0 -- but hopefully you are actually running at least ver. 3.1.1 if not 3.1.5 because version 3.0 simply does not work well with PHP 7, if at all. When you are logged in and go to the Admin Dashboard page, and look near the upper right hand corner: there should be a box that gives the real version number that shows either:

Gallery stats
  • Version: 3.1.3 (Revival)
  • Albums:
  • Photos: 

Gallery stats
  • Version: 3.1.5 (Revival)
  • Albums:
  • Photos:
Before trying to modify the permission script (a very risky thing to do) please confirm which version of Gallery you are running.

-- J.R.

Jon Schewe

unread,
Feb 28, 2023, 10:42:06 PM2/28/23
to gallery...@googlegroups.com
This is what I see in the stats:
    • Version: 3.0+ (branch master, build 434)
    • Albums: 638
    • Photos: 13342

    I know I've upgraded this gallery instance before. I've got 3.1.5.zip sitting in my home directory from January of this year.

    The README.md says:
    Gallery 3.1+ (development version)

    The database shows that the gallery module is at version 58.

    Jon Schewe

    unread,
    Feb 28, 2023, 10:48:24 PM2/28/23
    to gallery...@googlegroups.com
    I just checked the .build_number file and it matches.

    Here is from my installation:
    >cat /home/httpd/html/gallery/.build_number
    ; This file keeps track of the build number for the "master"
    ; branch of gallery3. It's kept up to date by an automated
    ; process. You don't need to edit it. In fact..
    ;
    ; DO NOT EDIT THIS FILE BY HAND!
    build_number=434

    Here is from the 3.1.5.zip file:
    >cat ~/tmp/gallery3-3.1.5/.build_number
    ; This file keeps track of the build number for the "master"
    ; branch of gallery3. It's kept up to date by an automated
    ; process. You don't need to edit it. In fact..
    ;
    ; DO NOT EDIT THIS FILE BY HAND!
    build_number=434

    J.R.

    unread,
    Mar 1, 2023, 12:53:05 PM3/1/23
    to gallery...@googlegroups.com
    John,

    OK, then. You're continuing to run a version of Gallery which simply does not work well with PHP 7 and up. This situation has been known for 2 years and an upgraded was created back then to address the situation. In fact, you have had version 3.1.1 downloaded for a year but refused to install it. Now you're perplexed when something in your 3.0 installation doesn't work? You're lucky anything in your installation works properly. Yet you want our help? Like the man said, "that does not compute".

    Sorry, but two years after 3.1.1 came out, I can't see the point in anyone spending time trying to fix something that simply doesn't work in modern hosting environments. My only suggestion -- and I've said this to you before -- is upgrade to at least 3.1.1 or look for another image hosting program.

    Sheesh.

    -- J.R.

    J.R.

    unread,
    Mar 1, 2023, 12:59:14 PM3/1/23
    to gallery...@googlegroups.com
    One final thought: You may have downloaded ver 3.1.1 very early on. There were several tweaks made to that version after it went into service, so you should delete the download you have and go to https://galleryrevival.com and download it again to make sure you have the latest/last version of 3.1.1 -- except what you should really do at this point is forget about 3.1.1 and simply download version 3.1.5 and get the latest, most complete solution.


    John,

    OK, then. You're continuing to run a version of Gallery which simply does not work well with PHP 7 and up. This situation has been known for 2 years and an upgraded was created back then to address the situation. In fact, you have had version 3.1.1 downloaded for a year but refused to install it. Now you're perplexed when something in your 3.0 installation doesn't work? You're lucky anything in your installation works properly. Yet you want our help? Like the man said, "that does not compute".

    Sorry, but two years after 3.1.1 came out, I can't see the point in anyone spending time trying to fix something that simply doesn't work in modern hosting environments. My only suggestion -- and I've said this to you before -- is upgrade to at least 3.1.1 or look for another image hosting program.

    Sheesh.

    -- J.R.

    On 2/28/23 10:41 PM, Jon Schewe wrote:

    Jon Schewe

    unread,
    Mar 2, 2023, 8:22:34 AM3/2/23
    to gallery...@googlegroups.com
    I'm very confused here. I thought I had upgraded to 3.1.1 and beyond. I'm looking at the .build_number file in my installation and comparing it to what's inside the 3.1.5 zip file under the assumption that this will tell me if I have that version installed. I downloaded the 3.1.5.zip file from https://galleryrevival.com and the .build_number file still shows 434. Is this not an accurate way to check for the version information? I'm looking for another way to check the version because I'm not sure if the displayed version is from something inside my database that didn't get properly updated or if I somehow have reverted the code in my gallery.

    I'm not asking for support for some old version. I'm trying to figure out how I've ended up with what appears to be an old version despite having applied all of the updates and what's the right way to fix this versioning issue. 

    Jon Schewe

    unread,
    Mar 2, 2023, 8:35:40 AM3/2/23
    to gallery...@googlegroups.com
    To make sure I've got everything correct I tried the upgrade again. Here are the commands that I executed.

    unzip 3.1.5.zip
    cd 3.1.5
    cd gallery3-3.1.5/
    sudo systemctl stop apache2
    cd /home/httpd
    cd html/
    sudo mv gallery gallery.unknown
    sudo mv ~jpschewe/src/gallery3-3.1.5 gallery
    sudo chown -R www-data gallery
    cd gallery
    cd /home/httpd
    cd html
    cd gallery.unknown/
    sudo mv var ../gallery
    sudo cp -r themes/clean_canvas themes/greydragon/ ../gallery/themes/
    sudo cp -r modules/{default_sort,editowner,html5_upload_progress,html_uploader,moduleorder,plupload,purifier} ../gallery/modules/
    sudo chown -R www-data ../gallery
    sudo systemctl restart apache2
    I was presented with a page that I'm all set.
    I went to the admin dashboard and saw:

    Version: 3.0+ (branch master, build 434)
    Albums: 638
    Photos: 13342


    What am I missing here?

    Mike Wickham

    unread,
    Mar 2, 2023, 10:48:15 AM3/2/23
    to gallery...@googlegroups.com
    I'm not having any particular problems, but I have similar results to
    this user. I just now upgraded from 3.1.3 to 3.1.5. Forum was in
    maintenance mode. Instructions say to go to
    http://www.example.com/gallery3/index.php/upgrader afterward, and follow
    the instructions on the upgrader page. I went to that address, but there
    was no upgrader page with instructions, and no confirmation. Only a
    login page. I logged in and my dashboard now says "Version: 3.0+ (branch
    master, build 434)," whereas it previous said "Version: 3.1.3."

    I would note that the .build_number file in both 3.1.3 and 3.1.5
    installation zip files have identical content (build_number=434) and
    differ only by file date.

    Mike Wickham

    J.R.

    unread,
    Mar 3, 2023, 7:38:26 PM3/3/23
    to gallery...@googlegroups.com
    Jon,

    Whoa... I wish you'd mentioned using this procedure before. I personally have never tried to upgrade Gallery (or install it new from scratch) from the command line interface. Didn't even know you could -- I'll have to leave it to the unix/linux gurus to say. Maybe Brad Dutton can weigh in here. I have never downloaded a Gallery zip in any way other than using the download link on Dan's website at https://galleryrevival.com/  ...which does in fact pull the package from the location you specified:  https://github.com/bwdutton/gallery3/archive/3.1.5.zip

    But maybe the command line process might have:

    1) been unable to modify whatever settings the Admin Dashboard uses to display the version number, even if the rest of the update to 3.1.5 was successfully completed... So the stat box displays the old default version number of 3.0+

    or

    2) been unable to update absolutely every single thing necessary (all scripts, database tables, "included modules" and internal flags) -- so even though no error messages were thrown, it did not actually upgrade the old Gallery installation at all and left it at 3.0+? Maybe? I'm out of my depth here...

    As for your original issue of the images not being visible when an album was set to "private" but became visible again when set back to "public" viewing, I can only suggest an old school test:

    Download 3.1.5 and install it from scratch in a completely new location, using default settings and the default theme. Log-in and check the admin dashboard stat box and see what version number it displays. Create a sub album or two, then upload few images to each. Then one of them "private" and see if the images disappear again or remain visible. If they stay visible in this "new from scratch" gallery installation, then clearly something went off the track when upgrading the existing site.

    Best of luck.

    -- J.R.

    Jon Schewe

    unread,
    Mar 3, 2023, 11:49:53 PM3/3/23
    to gallery...@googlegroups.com, J.R.
    Using curl is the same as using a web browser. It just removed the need to copy the zip file to the server. How do you usually do this?

    Can you post your steps and we can compare to see what I've done differently other than using curl instead of a web browser?
    --
    Sent from my Android device with K-9 Mail. Please excuse my brevity.

    Jon Schewe

    unread,
    Mar 4, 2023, 12:10:19 AM3/4/23
    to gallery...@googlegroups.com, J.R.
    Just for comparison. I've attached 2 images to this email (which may be scrubbed). One is what I see when I visit the upgrader page and the second is after I click the X in the dialog. The text of the page is below.


    Module name Installed version Available version
    Autorotate 3 3
    Comments 8 8
    Exif Data 1 1
    Gallery 3 58 58
    Info 3 3
    Movie Resized 1 1
    Organize 4 4
    REST API Module 3 3
    RSS 1 1
    Search 1 1
    Server Add 4 4
    Tags 3 3
    Users and Groups 4 4
                
    gallery-upgrader.png
    gallery-upgrade-message.png

    Jon Schewe

    unread,
    Mar 14, 2023, 11:14:52 PM3/14/23
    to gallery...@googlegroups.com, J.R.
    I went through the code tonight and figured out why the version I see is 3.0+ rather than something like 3.1.5.

    The file modules/gallery/helpers/gallery.php has the following at the top:
    const VERSION = "3.0+";
    const CODE_NAME = "";
    const RELEASE_CHANNEL = "git";
    const RELEASE_BRANCH = "master";

    The method that displays the version is 

    static function version_string() {
    if (gallery::RELEASE_CHANNEL == "git") {
    $build_number = gallery::build_number();
    return sprintf(
    "%s (branch %s, %s)", gallery::VERSION, gallery::RELEASE_BRANCH,
    $build_number ? " build $build_number" : "unknown build number");
    } else {
    return sprintf("%s (%s)", gallery::VERSION, gallery::CODE_NAME);
    }
    }

    This is what is inside the 3.1.5.zip file. So that explains the version issue. 

    If I go back to 3.1.3.zip from https://github.com/bwdutton/gallery3/archive/refs/tags/3.1.3.zip I see that the constants are defined differently:
    const VERSION = "3.1.3";
    const CODE_NAME = "Revival";
    const RELEASE_CHANNEL = "release";
    const RELEASE_BRANCH = "release/3";


    My guess is that J.R. is using something older than 3.1.5 or has customized these values to show a different version in their release.


    As far as the permission issues, I have yet to solve that. I added debugging to the access.php file and I thought that was the issue, however that's working as expected. When I change the exception handling for 404 errors to show the full stack I get the following:
    2023-03-15 02:56:00 +00:00 --- error: Kohana_404_Exception [ 43 ]: The page you requested, file_proxy/4-26-2019/.album.jpg, could not be found.
    /home/httpd/html/gallery/modules/gallery/controllers/file_proxy.php [ 54 ]
    #0 [internal function]: File_Proxy_Controller->__call()
    #1 /home/httpd/html/gallery/system/core/Kohana.php(302): ReflectionMethod->invokeArgs()
    #2 /home/httpd/html/gallery/system/core/Event.php(208): Kohana_Core::instance()
    #3 /home/httpd/html/gallery/application/Bootstrap.php(67): Event_Core::run()
    #4 /home/httpd/html/gallery/index.php(124): require('/home/httpd/htm...')
    #5 {main}

    This is inside the check if the requested URI is inside var. This code was modified between 3.1.3 and 3.1.5 per the diff https://github.com/bwdutton/gallery3/compare/3.1.3...3.1.5
    Given that I noticed this problem recently and I remember updating to 3.1.5 it seems reasonable that the problem is here.

    I've added logging to show the failure:
    2023-03-15 03:05:30 +00:00 --- error: File is not inside var compare: /gallery/gallery/var/resizes/jpschewe/security/security-2008-09-29/pict0006.jpg var: /gallery/var/ request: /gallery/var/resizes/jpschewe/security/security-2008-09-29/pict0006.jpg

    It appears that when the variable compare_uri is constructed from request_uri, the extra "/gallery" is getting added and the comparison against "/gallery/var/" is therefore failing.
    Leaving my debugging on and visiting an image that does load, it appears that file_proxy is only used for images that guest cannot view.

    Jon Schewe

    unread,
    Mar 14, 2023, 11:19:20 PM3/14/23
    to gallery...@googlegroups.com, J.R.
    Removing the use of compare_uri and using request_uri as 3.1.3 did solved my issue.

    J.R.

    unread,
    Mar 18, 2023, 8:00:28 PM3/18/23
    to gallery...@googlegroups.com
    Jon,

    Great. We haven't heard from Brad Dutton lately, but I'm sure he'll make the change to the download version. And, yeah... I have a mix of gallery sites a couple of which I left at 3.1.3 just so I had something I could compare to 3.1.5 version when it was new. That reminds me I really should finally upgrade those two remaining 3.1.3 sites...

    -- J.R.

    Wong Siu

    unread,
    Mar 19, 2023, 7:26:31 AM3/19/23
    to gallery...@googlegroups.com
    Hi,

    I am new and not well-known with Unix,  I am asking if is there any way to easily upgrade 3.1.3 or 3.1.5 under Microsoft Windows. Our alumni's site still uses Gallery 3.0.9 which is not able to use Adobe for many years.  http://www.hktaitung.com/gallery/

    Sincerely,
    Wong 

    J.R.

    unread,
    Mar 19, 2023, 3:41:43 PM3/19/23
    to gallery...@googlegroups.com
    Wong,

    Windows users can look at Gallery pages using their web browser
    .  But Gallery does not run under Windows -- Gallery is designed to work on web servers running some form of Unix with PHP 7.4 or greater, such as Apache. You have to upgrade the version 3.0.9 of Gallery now running on your server to Gallery version 3.1.5 -- NOTE: do not bother with version 3.1.1 to 3.1.3 which are out of date. Unfortunately, this is no longer an easy thing to do and requires that you or your tech expert have access to the web hosting server account where hkaitung.com is currently installed, plus knowledge of the server's PHP configuration.

    If you are not an experienced tech person you can try asking your hosting company if they can do the upgrade for you (instructions below).

    For an experienced tech person, follow these steps to attempt the upgrade from Gallery version 3.0.9 to 3.1.5:

        1) Download the latest version of Gallery 3 from  galleryrevival.com  (note: use only the current version 3.1.5 download)

        2) Log-in to your web hosting server account and using it's "File Manager" app, navigate to the folder on your server where your old Gallery website files are installed -- often this server location will be /public_html/ . By default your old Gallery 3.0.9 installation should be in a folder called   /gallery3   but it may be called something else.

        3) Into this server location --b
    ut not into your old Gallery 3.0.9 folder -- upload the file you got from galleryrevival.com and then extract it into a new folder -- it is strongly recommended this new folder be named:   /gallery3_new -- NOTE:  the file permissions and ownership on the new folder must be identical to those of your old Gallery 3.0.9 folder.

        5) Navigate into your old Gallery 3.0.9 
    /gallery3  folder .
      
        5) Inside that folder is a another folder named  /var/  -- using the server's "file manager" program, copy the entire   /var/  folder into the  /gallery3_new folder.

      
        6) Now rename your old Gallery 3.0.9 folder to /gallery3_old   -- NOTE: It is a good idea to keep  /gallery3_old on the server in case you need it again.

        7) Rename the 
    /gallery3_new  folder to the same folder name you were using for your old Gallery 3.0.9  folder
             (example: from /gallery3_new  to  /gallery3 ).
       
        8) Browse on the internet to your existing Gallery URL but add /upgrader at the end of the URL
             (example: https://www.example.com/gallery3/index.php/upgrader )

        9) Follow the instructions on the upgrader page which appears.

      10) When the upgrade process has completed, browse again on the internet to your normal Gallery URL and check it is working properly.

    ...as I said, the above should be done only by an experienced tech person who understands what the above instructions mean and just what the end result should be.

    If you are not an experienced tech person, the best and easy thing to do is t
    o switch to a program called PIWIGO, which is easy to install on your server and then upload the pictures from your old Gallery 3.0.9 into your new PIWIGO gallery. See:

    https://piwigo.org/what-is-piwigo

    -- J.R.

    Wong Siu

    unread,
    Mar 20, 2023, 3:33:31 PM3/20/23
    to gallery...@googlegroups.com
    J.R.

    Wow! It is great that you give me the detailed installation. I am retired and had served in the data field for 40 years. I shall do it later. Otherwise, I try to use PIWIGO that you recommended. Thank you very much. 

    Truly,
    Wong

    willem....@gmail.com

    unread,
    Mar 21, 2023, 4:53:42 PM3/21/23
    to Gallery 3 Users
    Also for me reverting the changes in modules/gallery/controllers/file_proxy.php did solve the issue for me, thank you.
    After the upgrade to 3.1.5 I noticed a performance improvement, thank you for the effort in maintaining the code.

    Op woensdag 15 maart 2023 om 04:19:20 UTC+1 schreef Jon Schewe:

    Bernd Bonnlaender

    unread,
    Mar 31, 2023, 11:57:19 AM3/31/23
    to Gallery 3 Users
    I did the upgrade to 3.1.5/php8 (thx that development moves on) and have only problems with filenames containing spaces (2023-03-15 11:44:55.jpg or probably special characters).

    I tired to disable/delete SetHandler Gallery_Security_Do_Not_Remove in .htaccess (vendor/bin subtree) but no success.

    Where is the filtering done? Is it php or Gallery?

    I have >13.000 images of which approx. 1000 with spaces, would mean a lot of changing.

    Thx for any hints,

    Bernd

    Bernd Bonnlaender

    unread,
    Apr 11, 2023, 1:40:57 PM4/11/23
    to Gallery 3 Users
    I managed to escape the space by adding B to the rewrite rules in .htaccess in var/albums, thumbs and resizes

    Thx for the great work on gallery (only 3.1.5 version is now missing in running footer)

    David and Jackie Armstrong

    unread,
    Apr 30, 2023, 9:01:29 AM4/30/23
    to gallery...@googlegroups.com
    Jon,

    Where did you make this change from compare_uri to request_uri to start showing images again in protected albums?

    Regards,

    David Armstrong.

    Brad Dutton

    unread,
    May 1, 2023, 11:35:52 AM5/1/23
    to Gallery 3 Users
    I'm guessing it's this change that people have said is causing problems:

    David and Jackie Armstrong

    unread,
    May 1, 2023, 1:05:40 PM5/1/23
    to gallery...@googlegroups.com
    Brad,

    Thanks, this does the trick. Hidden albums are now showing images correctly.

    Regards,

    David Armstrong.

    Jon Schewe

    unread,
    May 2, 2023, 8:57:48 PM5/2/23
    to gallery...@googlegroups.com
    Here's the unified diff for the code change. There is some commented out debugging in there as well.

    diff -ur --exclude var --exclude '*~' gallery3-3.1.5/modules/gallery/controllers/file_proxy.php gallery/modules/gallery/controllers/file_proxy.php
    --- gallery3-3.1.5/modules/gallery/controllers/file_proxy.php 2021-10-26 20:49:24.000000000 -0500
    +++ gallery/modules/gallery/controllers/file_proxy.php 2023-03-16 07:06:50.000000000 -0500
    @@ -48,16 +48,27 @@
    $compare_uri = url::file(ltrim($request_uri,'/'));
    + //JPS
    + // Kohana_Log::add("error", "request: " . $request_uri);
    + // Kohana_Log::add("error", "ltrim(request): " . ltrim($request_uri, '/'));
    + // Kohana_Log::add("error", "url::file(ltrim(request)): " . url::file(ltrim($request_uri, '/')));
    + // Kohana_Log::add("error", "rawurldecode(url::file(ltrim(request))): " . rawurldecode(url::file(ltrim($request_uri, '/'))));
    + // Kohana_Log::add("error", "base url: " . url::base());
    +
    // Make sure that the request is for a file inside var
    - $offset = strpos(rawurldecode($compare_uri), $var_uri);
    + //JPS $offset = strpos(rawurldecode($compare_uri), $var_uri);
    + $offset = strpos(rawurldecode($request_uri), $var_uri);
    if ($offset !== 0) {
    + //JPS
    + Kohana_Log::add("error", "File is not inside var compare: " . $compare_uri . " var: " . $var_uri . " request: " . $request_uri);
    $e = new Kohana_404_Exception();
    $e->test_fail_code = 1;
    throw $e;
    }
    // file_uri: albums/foo/bar.jpg
    - $file_uri = substr($compare_uri, strlen($var_uri));
    + //JPS $file_uri = substr($compare_uri, strlen($var_uri));
    + $file_uri = substr($request_uri, strlen($var_uri));
    // type: albums
    // path: foo/bar.jpg

    Jon Schewe

    unread,
    May 2, 2023, 8:58:40 PM5/2/23
    to gallery...@googlegroups.com
    That would be it.

    J.R.

    unread,
    May 5, 2023, 4:34:55 PM5/5/23
    to gallery...@googlegroups.com
    Jon,

    Outstanding. Thanks!

    -- J.R.
    Reply all
    Reply to author
    Forward
    0 new messages