WebProWorld Part of WebProNews.com
Page One Link To Us Edit Profile Private Messages Archives FAQ RSS Feeds  
 

Go Back   WebProWorld > Site Design > Graphics & Design Discussion Forum
Subscribe to the Newsletter FREE!


Register FAQ Members List Calendar Arcade Chatbox Mark Forums Read

Graphics & Design Discussion Forum Post your graphics design questions/comments/ideas in here. Ask questions, post tutorials, discuss trends and best practices. Sub-forum for website accessibility and usability.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 10-16-2006, 06:37 PM
kgun's Avatar
kgun kgun is online now
WebProWorld 1,000+ Club
 

Join Date: May 2005
Location: Norway
Posts: 4,695
kgun RepRank 3kgun RepRank 3
Default Manipulating images with code like PHP.

You may use different software tools to manipulate images. Since I am working with PHP, this post is about image manipulation using PHP's inbuild functions, making your own classes or importing third party class libraries.

1. Important background. Mime types.

MIME types stands for Mulitpurpose Internet Mail Extension that has become the de facto standard for describing content types on the internet. When you are working with images, it is absolutely necessary that you specify and use the correct MIME type.

Examples:
Content type: image/jpeg (JPEG/JPG file type)
Content type: image/bmp (Windows bitmap .bmp)
Content type: image/xml+svg (Scalable Vector Graphics .svg)

Working with wrong or no MIME type may cause you a lot of trouble.

2. How can I manipulate images with the help of PHP?
You can do a lot more than you may imagine with PHP's graphic functions like storing them in a variable, in a database as binary image data, resizing them, create watermarks, using images with text to stop bots from logging into your site etc. etc. And there are a lot of third party libraries with seamless classes that increase and extends PHP's image functions. Among the best known are ImageMagick that comes with two books to explain the use of the classes and JpGraph

3. Creating Thumnail images.
That is a five step process:
  • Load the source variable into a PHP variable.
  • Determine the hight and with of the original image.
  • Create a blank thumbnail image of the correct size.
  • Copy the original image to the blank thumbnail.
  • Display the thumbnail using the correct content type.

4. Additional information and resources.
See OopSchool under the heading: "PHP resources for image manipulation."
Reply With Quote
Reply

  WebProWorld > Site Design > Graphics & Design Discussion Forum
Tags: code, images, manipulating, php



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



Search Engine Friendly URLs by vBSEO 3.0.0