Hi,
/back after 2+ years and one kid more :-) + no new version of GLinks :-(
I played with Thumb_Images after long time and found some problems.
Glinks version 3.3.0
Global for displaying images/paths from:
http://www.gossamer-threads.com/forum/?do=post_view_flat;post=292819#p292819
Thumb_Images version 5.7
Files:
1. "111222333.jpg"
2. "space in 111222333.jpg"
3. "characters äüč-_ and space 111222333.jpg"
4. "characters šđčćž and space 111222333.jpg"
Thumb_Images Plugin Hooks - disabled
------------------------------------
Results for file 1.:
Glinks results:
../30-111222333.jpg
Working fine
Results for file 2.:
Glinks results:
../30-space%2520in%2520111222333.jpg
Working fine
Results for file 3.:
Glinks results:
../30-characters%2520%25C3%25A4%25C3%25BC%25C4%258D-_%2520and%2520space%2520111222333.jpg
Working fine
Results for file 4.:
Glinks results:
../30-characters%2520%25C5%25A1%25C4%2591%25C4%258D%25C4%2587%25C5%25BE%2520and%2520space%2520111222333.jpg
Working fine
Thumb_Images Plugin Hooks - enabled
------------------------------------
Results for file 1.:
Glinks results:
../30-111222333.jpg
Working fine
Thumb_Images result:
../thumb1-30-111222333.jpg
Working fine
Results for file 2.:
Glinks results:
../30-7m5JusejVv.jpg
Working fine
Thumb_Images result:
../thumb1-30-7m5JusejVv.jpg
not working - thumb is not displayed/not exist
After running Thumb_Images cleanup:
../thumb1-30-7m5JusejVv.jpg
Working fine
Results for file 3.:
Glinks results:
../30-V4lNlYK86y.jpg
Working fine
Thumb_Images result:
../thumb1-30-V4lNlYK86y.jpg
not working - thumb is not displayed/not exist
After running Thumb_Images cleanup:
../30-V4lNlYK86y.jpg
Working fine
Results for file 4.:
Glinks results:
../30-V4lNlYK86y.jpg
Working fine
Thumb_Images result:
../thumb1-30-V4lNlYK86y.jpg
not working - thumb is not displayed/not exist
After running Thumb_Images cleanup:
../30-V4lNlYK86y.jpg
Working fine
Even if you have Thumb_Images hooks disabled it affects filename.
If you have this file (v2 characters Ššđčćž and space 111222333.jpg) already in DB (generated by GLinks)
../30-v2%2520characters%2520%25C5%25A0%25C5%25A1%25C4%2591%25C4%258D%25C4%2587%25C5%25BE%2520and%2520space%2520111222333.jpg
and after that you turn on Thumb_Images and run cleanup you will get:
../thumb1-30-v2%252520characters%252520%2525C5%2525A0%2525C5%2525A1%2525C4%252591%2525C4%25258D%2525C4%252587%2525C5%2525BE%252520and%252520space%252520111222333.jpg
which is not OK (image is not displayed with <%Plugins::Thumb_Images::ThumbURL($ID,'Photo_01','Links','thumb1')%>)
filename of actual Thumb_Images created file on disk is:
thumb1-30-v2%20characters%20%C5%A0%C5%A1%C4%91%C4%8D%C4%87%C5%BE%20and%20space%20111222333.jpg
I tried to limit filenames user can submit with regex but with poor results.
^(?:|[\w-\.]+\.(?i:jpg|jpeg|jpe|gif|png))$
I tried to limit filenames with this regex but...
Upload filename is 000f äüč 0415 xys.jpg
and the error returned is:
Could not unlink file ../30-JG6FgV5Mf4.jpg: No such file or directory
instead of GLinks regular error (I believe its ADD_ILLEGALVAL)
and the actual Thumb_Images files are created on disk "thumb1-30-JG6FgV5Mf4.jpg" etc.
It seems that Thumb_Images is unaware of regex
Thumb_Images for cricket.png will be created fine but Cricket.png will not.
Same with cricket.PNG which is pretty good filename/extension
^(?:|.*\.(?i:jpg|jpeg|jpe|gif|png))$
with this regex i wanted to just check for correct extensions
filenames like 000f äüč 0415 xys.jpg should be OK and GLinks accept and upload file but
thumbnails are not created
^(?:|.*\.(?i:jpg|jpeg|jpe|gif))$
If someone uploads png image this error occurs
A fatal error has occurred:
Photo_01 can not contain 'DrQG2wskH7.png' at .../admin/Plugins/Thumb_Images.pm line 2134.
Please enable debugging in setup for more details.
^(?:|.*\.(?i:jpg|jpeg|jpe|png))$
if gif is not allowed standard GLinks error is displayed
and then if you upload another image with good extension thumbs are not created
After all tests I am left with many images on disk and I dont't know which an be deleted and which one
is used on site. There should be an option either check for old thumbs and delete them if we wish or to store
thumbs in separate directory which we could delete if needed and recreate thumbnails.
Also option to only run Cleanup for specific ID is a must if you have few thousand images and you want to recreate only one.
To be available to admin and to the user.
Thanks
/back after 2+ years and one kid more :-) + no new version of GLinks :-(
I played with Thumb_Images after long time and found some problems.
Glinks version 3.3.0
Global for displaying images/paths from:
http://www.gossamer-threads.com/forum/?do=post_view_flat;post=292819#p292819
Thumb_Images version 5.7
Files:
1. "111222333.jpg"
2. "space in 111222333.jpg"
3. "characters äüč-_ and space 111222333.jpg"
4. "characters šđčćž and space 111222333.jpg"
Thumb_Images Plugin Hooks - disabled
------------------------------------
Results for file 1.:
Glinks results:
../30-111222333.jpg
Working fine
Results for file 2.:
Glinks results:
../30-space%2520in%2520111222333.jpg
Working fine
Results for file 3.:
Glinks results:
../30-characters%2520%25C3%25A4%25C3%25BC%25C4%258D-_%2520and%2520space%2520111222333.jpg
Working fine
Results for file 4.:
Glinks results:
../30-characters%2520%25C5%25A1%25C4%2591%25C4%258D%25C4%2587%25C5%25BE%2520and%2520space%2520111222333.jpg
Working fine
Thumb_Images Plugin Hooks - enabled
------------------------------------
Results for file 1.:
Glinks results:
../30-111222333.jpg
Working fine
Thumb_Images result:
../thumb1-30-111222333.jpg
Working fine
Results for file 2.:
Glinks results:
../30-7m5JusejVv.jpg
Working fine
Thumb_Images result:
../thumb1-30-7m5JusejVv.jpg
not working - thumb is not displayed/not exist
After running Thumb_Images cleanup:
../thumb1-30-7m5JusejVv.jpg
Working fine
Results for file 3.:
Glinks results:
../30-V4lNlYK86y.jpg
Working fine
Thumb_Images result:
../thumb1-30-V4lNlYK86y.jpg
not working - thumb is not displayed/not exist
After running Thumb_Images cleanup:
../30-V4lNlYK86y.jpg
Working fine
Results for file 4.:
Glinks results:
../30-V4lNlYK86y.jpg
Working fine
Thumb_Images result:
../thumb1-30-V4lNlYK86y.jpg
not working - thumb is not displayed/not exist
After running Thumb_Images cleanup:
../30-V4lNlYK86y.jpg
Working fine
Even if you have Thumb_Images hooks disabled it affects filename.
If you have this file (v2 characters Ššđčćž and space 111222333.jpg) already in DB (generated by GLinks)
../30-v2%2520characters%2520%25C5%25A0%25C5%25A1%25C4%2591%25C4%258D%25C4%2587%25C5%25BE%2520and%2520space%2520111222333.jpg
and after that you turn on Thumb_Images and run cleanup you will get:
../thumb1-30-v2%252520characters%252520%2525C5%2525A0%2525C5%2525A1%2525C4%252591%2525C4%25258D%2525C4%252587%2525C5%2525BE%252520and%252520space%252520111222333.jpg
which is not OK (image is not displayed with <%Plugins::Thumb_Images::ThumbURL($ID,'Photo_01','Links','thumb1')%>)
filename of actual Thumb_Images created file on disk is:
thumb1-30-v2%20characters%20%C5%A0%C5%A1%C4%91%C4%8D%C4%87%C5%BE%20and%20space%20111222333.jpg
I tried to limit filenames user can submit with regex but with poor results.
^(?:|[\w-\.]+\.(?i:jpg|jpeg|jpe|gif|png))$
I tried to limit filenames with this regex but...
Upload filename is 000f äüč 0415 xys.jpg
and the error returned is:
Could not unlink file ../30-JG6FgV5Mf4.jpg: No such file or directory
instead of GLinks regular error (I believe its ADD_ILLEGALVAL)
and the actual Thumb_Images files are created on disk "thumb1-30-JG6FgV5Mf4.jpg" etc.
It seems that Thumb_Images is unaware of regex
Thumb_Images for cricket.png will be created fine but Cricket.png will not.
Same with cricket.PNG which is pretty good filename/extension
^(?:|.*\.(?i:jpg|jpeg|jpe|gif|png))$
with this regex i wanted to just check for correct extensions
filenames like 000f äüč 0415 xys.jpg should be OK and GLinks accept and upload file but
thumbnails are not created
^(?:|.*\.(?i:jpg|jpeg|jpe|gif))$
If someone uploads png image this error occurs
A fatal error has occurred:
Photo_01 can not contain 'DrQG2wskH7.png' at .../admin/Plugins/Thumb_Images.pm line 2134.
Please enable debugging in setup for more details.
^(?:|.*\.(?i:jpg|jpeg|jpe|png))$
if gif is not allowed standard GLinks error is displayed
and then if you upload another image with good extension thumbs are not created
After all tests I am left with many images on disk and I dont't know which an be deleted and which one
is used on site. There should be an option either check for old thumbs and delete them if we wish or to store
thumbs in separate directory which we could delete if needed and recreate thumbnails.
Also option to only run Cleanup for specific ID is a must if you have few thousand images and you want to recreate only one.
To be available to admin and to the user.
Thanks