gd

Coding graphical progress bar in php (overlay issue)

巧了我就是萌 提交于 2019-12-11 09:27:28
问题 So far I have the background working, and I have the % bubble floating on top of the bar working. Everything went smoothly using the PHP/GD functions. But I can't figure out how to add the yellow part. I mean, I could overlay solid color easily. But how would I go in showing that progress bar with vertical stripes, gradients, rounded border and inner shadows? 回答1: Actually, I found an example using php , javascript , and html here, you can also use the jquery implementation here. And here is

gd2 not showing in phpinfo, is showing in php -i

[亡魂溺海] 提交于 2019-12-11 09:15:29
问题 I'm trying to get the gd2 extension to work on a WAMP stack (Win7(x64), Apache 2.4, PHP 5.3.26) I've enabled extension=php_gd2.dll in php.ini and restarted Apache. I believe my extension directory is reachable as I'm able to load other extensions (eg., curl, mbstring, etc.,) from the same location. Oddly, php -i lists gd as enabled, but there's no mention of it in phpinfo(): gd GD Support => enabled GD Version => bundled (2.1.0 compatible) FreeType Support => enabled FreeType Linkage => with

How can I auto adjust the width of a GD-generated image to fit the text?

不打扰是莪最后的温柔 提交于 2019-12-11 08:54:44
问题 I'm trying to display a number using GD. This number changes, so sometimes the width needs to change. Is there a way to calculate how wide the text will be so that I can dynamically set the width? 回答1: Yes, you can find out the dimensions of a text using imagettfbbox() (or imageftbbox() if you're using Freetype). 来源: https://stackoverflow.com/questions/4485630/how-can-i-auto-adjust-the-width-of-a-gd-generated-image-to-fit-the-text

unable to upload an image using gd library php

穿精又带淫゛_ 提交于 2019-12-11 08:32:36
问题 this php file receives data from a html file where an user uploads an image from his computer, as soon as the update button is clicked this php page returns an error in which it is stated that no such file or directory exists <?php error_reporting(E_ALL); ini_set('display_errors', 1);?> <?php $db = mysql_connect('localhost', 'pippo', 'pluto') or die ('Unable to connect. Check your connection parameters.'); mysql_select_db('moviesite', $db) or die(mysql_error($db)); // current images folder

opening image with Imagine gives 'An image could not be created from the given input'

浪尽此生 提交于 2019-12-11 07:16:23
问题 I'm using Imagine to resize images after uploading them with curl in /tmp : $_imagine = new \Imagine\Gd\Imagine(); $mode = \Imagine\Image\ImageInterface::THUMBNAIL_INSET; $image = $_imagine->open($path); // i.e $path = '/tmp/photo.jpg' // then resizing the $image It is working fine with any previously uploaded images in my /tmp , but when uploading this image http://newsimg.bbc.co.uk/media/images/67373000/jpg/_67373987_09f1654a-e583-4b5f-bfc4-f05850c6d3ce.jpg then trying to open it with

How to install GD library with Strawberry Perl

半世苍凉 提交于 2019-12-11 06:39:33
问题 I am attempting to install the GD library using Strawberry perl and GnuWin32. However, when I enter "install GD" in the CPAN shell, the following message appears: 'gdlib-config' is not recognized as an internal or external command, operable program or batch file. **UNRECOVERABLE ERROR** Could not find gdlib-config in the search path. Please install libgd 2.0.28 or higher. I believe perl is having difficulty locating the GD library installed at C:\Program Files\GnuWin32\bin, but I am not sure

How to control text alignment for text generated using `imagettftext()`?

六月ゝ 毕业季﹏ 提交于 2019-12-11 03:07:51
问题 Using the imagettftext function from the PHP GD library, one can only draw text that is left-aligned onto an image. At least so it would seem, perhaps I'm missing something. How can I control the alignment of the text drawn onto an image? i.e. left / center / right (/ justified - not necessary, but useful) I should mention that the alignment is visible when the drawn text contains multiple lines (e.g. "bla bla bla/nAnd another line of bla."). 回答1: with imagettftext() you're not writing into

Get image create date in PHP GD

我的梦境 提交于 2019-12-11 02:47:39
问题 I have a case: I took a photo. Now I want to read date of the created photo (the shooting photo date) using GD. Is it possible to get this date created from the image metadata? 回答1: Use exif_read_data() function instead, you will get everything you'd need :) http://php.net/manual/en/function.exif-read-data.php Look for the particular Exif data with a key DateTimeOriginal. Make sure that the software you are using are not stripping the actual exif. For example if you are using Photoshop, doing

Trouble cropping and resizing image

僤鯓⒐⒋嵵緔 提交于 2019-12-11 02:25:06
问题 I'm trying to create a thumbnail image for a larger image. I'm using Jcrop to get the co-ordinates of the crop but I can't turn this into a properly cropped thumbnail image. I've set up Jcrop properly and it's sending through x-y co-ordinates along with the size of the box but I can't work out how to crop from that. What I have is the path to an image on my server, along with 4 co-ordinates and the width and height of the square box they create (I've locked the aspect ratio to 1:1 as I want

How to create Image with custom text in php?

淺唱寂寞╮ 提交于 2019-12-11 01:48:45
问题 I am looking to create a Product customization tool in PHP. This tool will allow the user to create his own Customization to a predefined Mobile cover. I already have a Mobile cover image and I am looking to allow a user to write 3 characters which will be written in a circle called as monogram with a background color. I am not sure how to proceed ahead with it. I am looking to dynamically create image that is placed on the Mobile cover in such way that it looks its part. here is the link to