09/20/2022
http://www.supercala.net/phpBB3/viewtopic.php?f=17&t=259
Creating large photo images and touchups can be great on a local computer and apache server with php. but when you have to upload the images and allow a page to load those as a gallery of thumbnails, 200+ mb of images should be resized to be efficient.
What I did was install Imagemagick to windows 10 then I ran a script in PHP I wrote to find my galleries and make another folder replicating them if they didn't exist (none did when I did this, so 20 new gallery folders).
so I have
[data][img][galleries][*]
[data][img][gThumbs][*]
my script makes those gThumbs folders, which I initially created by hand, [website_folder][data][img] is my structure in the apache html root
I made a few files in each folder, kids in a group, then individual kids were photographed as well. I thought, if I rename the group pic to group_00.jpg and keep the names of the individual shots alone, I could scan each folder for a group_00 folder and group_00.jpg file for the gallery menu on the left hand side of my interface. I use 4k because it's easiest to manage so many images and galleries, then I used css grid and css flexbox so they will nicely fit even on smaller HD monitors or sub-windows on 4k.
There were some problems I sorted out with imagemagick's executable [CONVERT.EXE] I called with PHP's EXEC function... windows 10 also has [CONVERT.EXE]. One solution was to change my PATHs in windows to see imagemagick first, but I would rather just call it directly with a location in php. One problem is the [\] slash is [\\] double to be escaped in a php string, say $locStr needs windows paths to be double slashed for a single slash (escaped). Then there is the problem that for whatever reason, microsoft calls it's default program area "PROGRAM FILES" so I tried escaping the space and many ways it kept outputting in error.log of apache's server "C:\PROGRAM " is not a executable... it got lost at the space.
I found a simple command in php called ESCAPESHELLARG and you put your double slash for folders string in there and it fixes the space and suddenly the EXEC works, so I wrote the string, then put it in that ESCPAESHELLARG and saved it in a string itself, then just EXEC that new string:
Creating large photo images and touchups can be great on a local computer and apache server with php. but when you have to upload the images and allow a page to load those as a gallery of thumbnails, 200+ mb of images should be resized to be efficient.
What I did was install Imagemagick to windows 10 then I ran a script in PHP I wrote to find my galleries and make another folder replicating them if they didn't exist (none did when I did this, so 20 new gallery folders).
so I have
[data][img][galleries][*]
[data][img][gThumbs][*]
my script makes those gThumbs folders, which I initially created by hand, [website_folder][data][img] is my structure in the apache html root
I made a few files in each folder, kids in a group, then individual kids were photographed as well. I thought, if I rename the group pic to group_00.jpg and keep the names of the individual shots alone, I could scan each folder for a group_00 folder and group_00.jpg file for the gallery menu on the left hand side of my interface. I use 4k because it's easiest to manage so many images and galleries, then I used css grid and css flexbox so they will nicely fit even on smaller HD monitors or sub-windows on 4k.
There were some problems I sorted out with imagemagick's executable [CONVERT.EXE] I called with PHP's EXEC function... windows 10 also has [CONVERT.EXE]. One solution was to change my PATHs in windows to see imagemagick first, but I would rather just call it directly with a location in php. One problem is the [\] slash is [\\] double to be escaped in a php string, say $locStr needs windows paths to be double slashed for a single slash (escaped). Then there is the problem that for whatever reason, microsoft calls it's default program area "PROGRAM FILES" so I tried escaping the space and many ways it kept outputting in error.log of apache's server "C:\PROGRAM " is not a executable... it got lost at the space.
I am sure you can make something better, it's just online to help those who might not know how to do some things or are feeling pitfalls due to exec and paths, maybe even smaller images in web traffic be more efficient. Happy graphic coding.
I found a simple command in php called ESCAPESHELLARG and you put your double slash for folders string in there and it fixes the space and suddenly the EXEC works, so I wrote the string, then put it in that ESCPAESHELLARG and saved it in a string itself, then just EXEC that new string: