Linux Systems Administrator
Jupitermedia
US-AZ-Tucson

Justtechjobs.com Post A Job | Post A Resume

Resizing Images with PHP and Mogrify
One of the challenges for any web development team is creating systems that are technically robust while still being intuitive to users. It's especially important to keep in mind the level of technical proficiency of the intended users of the system. We were reminded of this crucial truism shortly after the initial launch of a site we recently built.
Our consulting division had been approached by a economic development organization who wanted us to build a website. One of the desired features of the site was a system that allowed their staff to upload member company logos to be displayed on the front page of their site, as well as in a member directory section. The intent was that businesses would send their logos to the organization staff, and they'd use the system to insert the new logos and descriptive text into a database. No problem, right?
Because Modwest runs PHP as a chrooted CGI, it was easy to use standard PHP upload features to get the logos from the client's personal computer up to the server and into a database. (See php.net/manual/en/features.file-upload.php for the basics.) What we originally failed to account for was the size of the uploaded images.
The Problem Unveiled
The launch of the site went nicely, and the first few logos uploaded fit the design of the site nicely. A few weeks down the line, a business sent in a logo that was over 800 pixels wide. Of course, as soon as the staff uploaded it into the system, it wrecked the design of the site, as the logos were meant to be displayed in columns that were only about 250 pixels wide. The staff member responsible for uploading called us immediately, wondering why our system had broken. Of course, the system was doing exactly as it was told.
Our first tactic was to suggest that the staff member resize logos to be no more than 200 pixels wide. This suggestion may have worked if we were talking to a graphics-savvy user, but this individual wasn't terribly comfortable using Windows Paint (the only graphics program they had available). So, we needed a solution that would auto-resize photos appropriately and maintain their original proportions to prevent any distortion.
[ Next Page ]


Comments:
Professional class to deal with imagesYuriy Horobey10/15/05 06:30
PerlmagickWayne04/11/05 12:02
RE: Thumbnail-ing with mogrify ymhuu03/16/03 13:41
RE: White Spacematthew03/04/03 09:41
RE: It won't work.Del Langrish01/29/03 05:17
It won't work.Marian01/13/03 08:31
RE: imagemagickMichael Montero11/22/02 08:53
Clipping path - Possible?Kim Steinhaug11/07/02 19:57
RE: GD qualityRasmus Hansen10/16/02 10:44
GD qualityYuriy Horobey09/22/02 16:22
exec and IM does not workGune09/19/02 08:42
TIFF (CMYK) to JPG (RGB)Josep09/13/02 06:42
Temporary ImagesSam Mateosian09/09/02 12:42
RE: White SpaceSi Watts08/19/02 19:21
White SpaceLeon Letto08/16/02 21:20
RE: Uploading imagesSi Watts08/11/02 14:04
RE: Thumbnail-ing with mogrify Si Watts08/11/02 14:01
Uploading imagesPraggers08/09/02 05:56
RE: Thumbnail-ing with mogrify Stephen08/08/02 13:31
RE: Thumbnail-ing with mogrify Matthew Calthrop08/06/02 09:28
Thumbnail-ing with mogrify Thorsten clausen08/02/02 05:15
No librarythrive07/29/02 15:01
Did it with netpbm packageGabe Miano07/28/02 10:59
RE: imagemagickSi Watts07/25/02 18:30
RE: Flipping imageSi Watts07/25/02 18:25
RE: Follow up for Mogrify -geometrySi Watts07/25/02 18:21
GD&TruecolorsYuriy Horobey07/25/02 15:51
Flipping imageSmarone07/24/02 10:33
RE: imagemagickRandy07/24/02 10:01
RE: Follow up for Mogrify -geometryJimcurry07/24/02 02:29
Follow up for Mogrify -geometrySi Watts07/23/02 11:18
RE: I did it only with PHP/GD (on PUBLIC servYuriy Horobey07/23/02 03:52
Professional PHP4 Multimedia Programmingthe_phpfreak07/23/02 01:46
Did this alsoAlex07/22/02 16:32
RE: I did it only with PHP/GD (on PUBLIC servsquashee07/22/02 05:41
-geometrySi Watts07/21/02 19:48
RE: I did it only with PHP/GD (on PUBLIC server)Daniel Higgins07/19/02 11:36
RE: imagemagickbill griffith07/18/02 21:17
GD/GIF supportMichael07/18/02 17:12
RE: imagemagickBen Smith07/18/02 12:33
RE: RE: imagemagickTrebel07/18/02 06:09
RE: PHP JPGResizeryuriy horobey07/18/02 03:59
PHP JPGResizerBankHacker07/17/02 16:14
I did it only with PHP/GD (on PUBLIC server)Yuriy Horobey07/17/02 15:48
Little improvement...HaploZ07/17/02 14:10
RE: imagemagickJoystickit07/15/02 19:50
imagemagickgabe07/15/02 13:52
On a public server?Adam07/14/02 21:08
-geometryAndy07/12/02 14:40
 

If you are looking for help, please post on the appropriate forum here. Your questions will be answered much more quickly.

Add A Comment:

Name:

Email:

Subject:

Message:

To reduce spam posts, messages are now manually approved

You are not [logged in]. That means your account will not get credit for this post.