Buttonmill glassy buttons

Use GD2 Only Option Update

Asked by Richard Virtue on 2011-01-19

As requested, the http://virtech.org/home/buttonmill installation has now been modified to add a config.php option (USEGD2) that, if set true, will allow the project to run entirely without ImageMagic support. The source download package there has been updated accordingly and the site itself is currently running with GD2 functions only. The "recent images" were all created that way for illustration purposes, but the site will likely revert to its normal ImageMagick configuration shorty to reduce the processor demands made by GD2.

For Eric's info, in addition to the new config.php option, two new functions have been added to the buttonincludes.php file and, at the same time, its former support for .SVG images has been dropped entirely. The new functions are set_transparent($imagefile) and img_resize($imagefile, $w, $h, $newfile) both of which replace IM mogrify functions when the USEGD2 option is chosen and the necessary PHP GD module is loaded. Similarly, the IM convert functions can now be handled by simple GD imagecreatefrom...() functions instead. The coding was a bit tricky for maintaining both transparancy and resizing, but I think you'll be pleased with the final results.

You may not be so pleased with my "realignment" of the help and colorpicker icons on the glassy.php page. I like 'em better lined up that way, but whether you adopt that particular "improvement" of mine is strictly optional. :^)

Question information

Language:
English Edit question
Status:
Answered
For:
buttonmill Edit question
Assignee:
No assignee Edit question
Last query:
2011-01-19
Last reply:
2011-01-22

The GD2 option looks great - thank you! I've updated the virtech branch accordingly.

Richard Virtue (rvirtue) said : #2

You're very welcome. Glad you like it okay. Those PHP/GD2 functions to set the alpha channel with transparency and then to retain both transparency and high resolution while also resizing the image had me frustrated for about three days. But I think I finally got it right.

At least the optional functions are now available as may be needed by some users on some servers, but personally, i'm sticking with Image Magick myself, :^)

Can you help with this problem?

Provide an answer of your own, or ask Richard Virtue for more information if necessary.

To post a message you must log in.