Gossamer Forum
Quote Reply
Thumb_Images tests
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 äü&#269; 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 äü&#269; 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
Quote Reply
Re: [Payooo] Thumb_Images tests In reply to
GForum messed up with some characters, test filenames are here

Last edited by:

Payooo: Nov 8, 2012, 2:26 PM
Quote Reply
Re: [Payooo] Thumb_Images tests In reply to
Hi,

I've actually written a new version (total re-write) of Thumb_Images. Unfortunately its far from ready to release yet. ATM it only does the image thumbnailing ( not reviews/category images). Its taken the related code down from thousands of lines of code, to just a couple of hundred. It also works much better with non-english characters (and handling errors). Now I know someone is actually interested in the update, I'll try and push it a bit more ;)

Unfortunately I havn't had many sales of plugins (in fact, none!) for the last year - so it seemed a bit pointless in re-writing them (the only reason I started this rewrite was due to me wanting to use it in one of my own sites). I'll give you a PM when I have something thats ready to test Angelic

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Payooo] Thumb_Images tests In reply to
Hi,

Could you please send me your email address? I'm not quite finished yet with the new version - but it should have a beta version ready for testing quite soon (ideally you need to test it on a new site, just in case it breaks anything Wink)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Payooo] Thumb_Images tests In reply to
Hi Payoo,

Did you get my Private Message? I have a new version which is ready to test ;) (I'm using it on 2 sites already - but it would be good for someone to also give it a good going over Wink)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!