TalkPHP

TalkPHP (http://www.talkphp.com/forums.php)
-   Show Off (http://www.talkphp.com/show-off/)
-   -   ImgBrowz0r 0.3 (http://www.talkphp.com/show-off/4188-imgbrowz0r-0-3-a.html)

FSX 04-25-2009 07:56 PM

ImgBrowz0r 0.3
 
Hey people, I was getting mails from this board, because I was inactive. So I thought let's try it again.

I released a beta of script, ImgBrowz0r, some days ago. The first update after almost 7 months and it includes lots of improvements. :)

It would be cool it someone wants to test it.

Here the project page: http://61924.nl/projects/imgbrowz0r.html
And here the development page: http://bitbucket.org/fsx/imgbrowz0r/

0.3-dev is the most recent one and you can download it from the development page (click on "get source"). 0.3-beta can be downloaded from the project page, but is a bit older than 0.3-dev.

I'll appriciate it if someone would like to test it and give feedback. :)

Wildhoney 04-26-2009 01:03 AM

More than one? I hope it hasn't been annoying you. Sorry about that!

FSX 04-26-2009 07:11 AM

It's no problem, I got this wonderful delete button. ;)

But stay ontopic and test my script (please). :)

FSX 04-28-2009 02:04 PM

Hmm, it's pretty inactive here, just like some months ago when I registered. How can I delete my account?

Jim 04-28-2009 02:33 PM

You'll have to run around your kitchentable screaming "LALALOOMPOOR" a total 25 times, come back to the forum, click on your avatar and pray to the gods to delete it.

sketchMedia 04-28-2009 04:12 PM

Quote:

Originally Posted by FSX (Post 23489)
Hmm, it's pretty inactive here, just like some months ago when I registered. How can I delete my account?

Why would you wan to do that?

FSX 04-29-2009 07:23 AM

Well, it's no use if I'm when it's inactive here.

Salathe 04-29-2009 10:29 AM

TalkPHP is a very small forum, you knew that when signing up. We aren't the type of forum which posts 2,000 new topics a day just to appear active; we're just here for when people need us for anything.

That your topic hasn't got any meaningful replies in two days (wow two whole days!) isn't particularly worrying. I had a quick look at your script the other day, and shelved it as "too look at later". After another quick look today, there are a few comments:
  • Your main (imgbrowz0r) class does pretty much everything. It is doing far too much, and should be split out into more useful discrete components. Your class mixes thumbnail generation, with HTML generation, with caching, etc.. In this sense, it isn't any more than procedural code wrapped up inside a class.
  • You repeat identical code a number of times. An example being checking against a whitelist of file extensions. You do this three times, there is scope for those whitelists not correlating in the future, after a few edits.
  • Thumbnails are name-based. What happens if I upload a new version of a file (keeping the same name). It doesn't appear as though the thumbnail will be regenerated. Will it?
  • HTML generation: what if I want to use different HTML for my site? I have to edit the imgbrowz0r class to do that. This should not be the case.
  • Making thumbnails. On line 354 you check to see if the cache directory is writable and it is not a directory (ie, a writable file). If not, you stop the execution with a contradictory error message. Also in this method (make_thumb), you don't destroy the $image GD resource.
  • The get_ext method. This will not do its job properly if provided a file without an extension. File "agif" will return extension "gif" even though it does not really have an extension. Suggestion: use pathinfo($file_name, PATHINFO_EXTENSION) or at least check if the file does really have an extension (strrpos will return boolean false if it can't find the needle).

All in all, a fair start and I'm sure many people would find the imgbrowz0r more than suitable for them. The above are just some thoughts, you don't have to heed them.

FSX 04-29-2009 03:23 PM

Ok, that was my fault then, sorry. When I signed up and asked for help I didn't get an answer at all.

I'm really grateful for your feedback.

1. I tried to make something that is ready to use in lets say 10 minutes, plug-in and run. I've not much experience with object-oriented programming (some things don't even make sense to me like interfaces) and I prefer to do everything procedural.

2. I'll fix that.

3. No, it doesn't. I could use timestamps in the names to ensure a new thumbnail is generated.

4. The HTML shouldn't be edited. With CSS and Javascript you should be able to do any visual changes. I've already separated the functions that generate the navigation from the display function.

5. Hehe, my mistake. I only focused on improving the quality of the thumbnails.

6. You're right. Thanks for the suggestion.

Thanks for your thoughts. I really appreciate it.

Edit:
I've committed the fixes for the bugs.

FSX 07-05-2009 02:48 PM

I've released some updated for ImgBrowz0r.

Project page: http://61924.nl/projects/imgbrowz0r.html
Screencast at CSS-Tricks: http://css-tricks.com/video-screenca...photo-gallery/
Wordpress integration: http://css-tricks.com/forums/viewtop...&t=3077#p14228


All times are GMT. The time now is 04:06 PM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0