gd

PHP - multiple users edit the same image simultaniously.

I am looking to have multiple users edit the same image using the gd library's imagecopymerge function. I am worried that two users might select to edit the image at the same time. The application then merge's the two users images seperately and finally saves them but one overwrites the other and thus one of the users images is missing....

dpkg error exit status 2

Trying to build php from source on Ubuntu 9.10 to enable GD2, but when i run dpkg-buildpackage, it just quits giving me this error: QUILT_PATCHES=debian/patches quilt --quiltrc /dev/null pop -a -R || test $? = 2 Patch suhosin.patch does not remove cleanly (refresh it or enforce with -f) make: *** [unpatch] Error 1 dpkg-build...

Image Resizing Question (PHP/GD)

I'm looking for help/suggestions in finding the most efficient way to resize an image to be as small as possible using PHP/GD while preserving the aspect ratio of the original image but ensuring the the resized image is bigger than a defined minimum width & height. For example, the resized image must have a width >= 400 and a height >= ...

How to load dynamic image w/php gd library, w/o saving it on server or having src="script.php" ??

I would like to generate a dynamic image from a script, and then have it load to the browser without being persistent on the server. However, I cannot call this by setting the image's src="script.php", since that would require running the script that just generated the page and its data all over again, just to get the final data that ...

GD Visual C++ 2008

Is there some step by step guide to link GD library ( www.libgd.org ) to the project in MSVS? Because I'm getting linker-errors when trying to compile my project: error LNK2019: unresolved external symbol _gdImageCreateFromJpeg referenced in function _main ...

Writing curved text on an arc (PHP)

So I Googled and found out how to draw an arc: http://www.php.net/manual/en/function.imagearc.php The only problem is how do I write text $margin pixels from the arc that is curved. Centre aligned @ $degrees. Here is an example: http://img194.imageshack.us/img194/3667/scan0001fe.jpg Let me know if this doesn't make sense. ...

Store an image into DB

Hi, I use a script (http://www.webmotionuk.co.uk/php-jquery-image-upload-and-crop-v11/) that handles an image and then create a thumbnail. Actually I don't want to store images on the file system but I want to store them in a mysql db in a BLOB field. I could first store the created thumbnail on the fs, store the file in the DB and af...

php resize images script

I am using directory iterator to iterate through directories and resize images found in that directory, I am doing this from browser cause I don't have ssh access to that server. Most pictures resize fine but for every 10 pictures (more or less) I get jiberish data out. I think it's a picture source. in that data there is always a string...

Resize image size according to size of text

The PHP code below generates text as a dynamically created image, how would I be able to get the image to only be as large as the text? Thanks. <?php header('Content-Type: image/jpeg'); $text='Test'; $img = imageCreate(200,200); imagecolorallocate($img, 255, 255, 255); $textColor = imagecolorallocate($img, 0, 0, ...

Calling a PHP function

I've got the following function that generates and saves an image based a text parameter. How can I call this in my file? I tried INCLUDE 'outPrice.php'; to link to the external PHP and called it with this command, outPrice($text); To which I got the following response. Warning: Cannot modify header information - headers already...

HTML Characters and []'s in Dynamic Image

I am making a dynamic image that parses off of an rss feed. When I do the parsing normally, it displays exactly as I want it to, but when I put it in the image, there are boxes and html characters like ' aren't actually apostrophes. Here's a link to my image as of right now (with boxes): http://img.got-skills.net/advlog/advlogmaker.php...

PHP/GD - Finding Image Resource Type

Having only a valid GD image resource is it possible to find out the type of the original image? For instance: $image = ImageCreateFromPNG('http://sstatic.net/so/img/logo.png'); Can I get the original image type (PNG) having only the $image variable available? ...

Creating image from transparent image mangles color

Hello! I'm building one kind of system, which simply creates dynamic image from other image. I use imagecreatefromstring(file_get_contents("clown_avatar.png")) to create image and output it successfully, but it messes all the colors on the transparent area. Check out the original image: Click And here is the result from php-file: Cli...

Image resize,crop with gd afresh every time or caching?

I found this really nice function that receives your desired proportions and resizes/crops the image for you. The function requires ImageMagick to work. Will it be better to cache the image or resize it every time? I'm pretty sure using gd will be slower than caching, but it won't require me to use ImageMagick, and I still haven't succe...

How can I upload an image from a URL in PHP

In PHP using GD or imagemagick how can I uplaod a photo from a URL, I want to build a function that I can pass in a few parameters and uplaod the image, I can currentyl uplaod a big image, resize it smaller, then resize some more thumbnails off it and save all into there locations from 1 image but I would like to add the ability to get a...

Cropping image in PHP

I'd like crop an image in PHP and save the file. I know your supposed to use the GD library but i'm not sure how. Any ideas? Thanks ...

Image processing and output using GD in php

I want to control the display of images with the PHP GD library -- I am going to add some text to the bottom corner of it on the fly when a browser requests the image, rather than saving the text into the image. I know that I can do this: set the MIME type in the header and then call imagepng(...) with the filename to just display the i...

Saving a transparent image from a URL in PHP

I am trying to build a class that does many photo operations, one method will uplaod images from a user but I am also needing to build a method to grab a photo from a URL and run other methods on it just like if it were being uploaded with a POST form from user. Below is my start of the function for getting image from URL, it works but ...

Looking for GD tutorial in C/C++

I see a lot of GD tutorials for PHP, even though GD was written in C, not PHP. Could you please suggest any good tutorial for GD in C? ...

PHP imagejpeg() problems

I had an image upload script that worked on my little shared hosting, but just as I switched to Virt Ded, it immediately stopped working. After some research I determined the culprit to be the PHP function imagejpeg() - which was the last bit of code in the script. It allows me to specify null as the filepath (in which case it prints it...