[wp-hackers] Crop a picture

Gregg F. Tomlinson gregg at fatheaddesign.com
Sat Sep 4 18:01:44 UTC 2010


Ryan:

If you're not opposed to jQuery for the zomed in pop-up, you might  
want to look at this: http://www.professorcloud.com/mainsite/cloud-zoom.htm

--g

...


On Sep 4, 2010, at 12:52 PM, Nathaniel Taintor wrote:

> If you want to do it in PHP, look into the ImageGD library. Its  
> included
> with almost all PHP5 installations that I've seen. Your code would  
> look
> something like this, to crop a 100px square from the top left of your
> original gif:
>
> $image = imagecreatefromgif( $url_to_src );
> $cropped = imagecreatetruecolor( 100, 100 );
> imagecopy( $cropped, $image, 0, 0, 0, 0, 100, 100 );
> imagegif( $cropped );
>
> More info: http://www.php.net/manual/en/ref.image.php
>
> But I'm not sure why you couldn't just do it with css, either using  
> the clip
> property, or just displaying your image in a div with overflow set to
> hidden.
>
>
> On Sat, Sep 4, 2010 at 1:19 AM, Ryan Bilesky <rbilesky at gmail.com>  
> wrote:
>
>> I did end up finding some javascript code for the expanded popup.   
>> But I
>> have still been unable to find some code that will take in a .gif  
>> image and
>> crop it (from top left corner) then output the cropped thumbnail  
>> image.
>>
>> On Fri, Sep 3, 2010 at 6:10 PM, Ryan Bilesky <rbilesky at gmail.com>  
>> wrote:
>>
>>> I am looking for a script to use with a plugin I am writing that  
>>> will
>> take
>>> an image stored on the server, and show me a cropped version. Then  
>>> when I
>>> put my mouse over the cropped version, the full version displays  
>>> is some
>>> popup panel that just goes right over the site and disappears when  
>>> my
>> mouse
>>> moves off of it.
>>>
>>> So it will need to be some combination of php and javascript. Is  
>>> anyone
>>> aware of such a script?
>>>
>>
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>

::::  ::::  ::::

Gregg Tomlinson
Principal

fathead design, inc.
1329 W. Loyola Ave.
Suite G2
Chicago, Illinois  60626

p: 773.338.1313
f: 773.338.1340

http://www.fatheaddesign.com

** please consider the environment before you print this e-mail **






More information about the wp-hackers mailing list