Jump to content

Archived

This topic is now archived and is closed to further replies.

fcarentz

Slice Image with PHP

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!

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

×

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.