Jump to content

Slice Image with PHP


fcarentz

Recommended Posts

Hey everyone. Working on a gallery type site currently and running into a problem.

In the gallery I want to display thumbnails before the user selects which pic they want to view the full image of.

However, a regular resizing is not what I'm after. I want to crop out a portion of the full size image to create a new picture to be used as a thumb.

check here [a href=\"http://www.gfxartist.com/community/member_galleries\" target=\"_blank\"]http://www.gfxartist.com/community/member_galleries[/a]

you will notice the smaller 64x64 thumbs are actually cut from a larger picture. So heres one of my issues that I can't seem to figure out as I am not familiar at all with the image functions of php or the gd library, which is installed on my server.

How can I make slices and have the code determine where to slice...I was thinking I could do this by reading the file and finding where the most concetrated work is and slice a 64x64 square from that area.

If anyone has any suggestions or can point me to any tutorials or code snippets that would be great!

Thanks!
Link to comment
Share on other sites

writing code to find the section to cut out is difficult!

what you can do in php is resample the entire graphic to make a smaller version of it. I have an upload class wirtten that you can ave that does this - just trying to find it - could take me a while. PM me later on and I will e-mail it to you with instructions.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.