gd2

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

CodeIgniter/PHP/GD2 Image Manipulation is playing up

a 夏天 提交于 2019-12-11 08:47:47
问题 I have a website going that takes a user's uploaded image, and makes three copies - a 'full' copy to print with (downsized to 1500x1125), a 'web' copy to display online (not coded yet), and finally a thumbnail. So here's the code - _imageformat() is passed the parameters (which I've confirmed to be correct) from CI's Upload Class: function _imageformat($fullpath, $shortpath, $width, $height) { // We now format the image. // First, we check if it is landscape or portrait if ($width >= $height)

how handling image's mime type “application/octet-stream”?

社会主义新天地 提交于 2019-12-10 14:53:59
问题 I have a function to make thumbnail of a url image on fly! I always pass to this functions images with type jpg, but the problem appears when I pass an image with ".jpg" extension. but when i try to get its mime type, i found that's " application/octet-stream " .. in this php page, this mime type refers to one of IMAGETYPE_JPC,IMAGETYPE_JPX,IMAGETYPE_JB2 what I need to modify my function to handle this mime type ?? notice ^^^^^^ function thumb($path,$width,$height) // $path => image url {

Is there a word wrap function for GD2 in php?

陌路散爱 提交于 2019-12-04 17:41:39
people. I have slight problem with GD2 text on image. I have everything working and now i try to add text on image that can wrap within image. For example i have image with width 200px and large block of text. If you use imagettftext() text goes beyond borders of image and only partial text actually is visible. I have tried to use Zend's text wrap function, but it's not always producing accurate results here(not saying it don't work, only not in this case). Is there some dedicated GD2 method to set some width box where text should fit and if it hits border of that box it should continue in new

Save image from one format to another with php gd2

可紊 提交于 2019-12-04 05:27:13
问题 I have a database with a column filled with image binaries data. After I made some research I figuried out how to detect in which image format is the data. Lets say in of the records in my images column is in gif format, now I want to save it with php gd2 to jpeg format. Please, can someone tell me how can I do that? 回答1: If you only want to convert the image data to JPEG then all you need is imagecreatefromstring and imagejpeg. Basically: imagejpeg(imagecreatefromstring($gif_bindata), "temp

ImageMagick or GD Library for image resizing and thumbnail creation?

对着背影说爱祢 提交于 2019-12-02 13:09:53
I had been using the image resize class written by someone else to resize images or to create the thumbnails, here is the link to the class I had been using. http://www.white-hat-web-design.co.uk/articles/php-image-resizing.php I guess image GD library has some limitations for the resolution or the file size of images, it works fine for low resolution picture resizing(below 1024px) but it does not resize if I try to upload the high resolution jpeg image (i.e 3400px X 2200px) roughly, The purpose for resizing the image is i am developing a picture gallery application. Is there any way I could

How to stop GD2 from washing away the colors upon resizing images?

耗尽温柔 提交于 2019-11-27 11:14:08
I have developed a photo sharing community site using CodeIgniter 1.7. Photos that are uploaded by members are automatically resized in a number of formats, for which I use the CodeIgniter Image Manipulation class. This class is built into the framework and basically a wrapper around multiple image manipulation libraries, such as GD, GD2, ImageMagick, and NETPBM. On my host, I can only make use of GD2, so that's where this question will be about. On to my problem. Here is an example of a resized photo on my site. Note that the original was very large, over 3000px wide: http://www.jungledragon

How to stop GD2 from washing away the colors upon resizing images?

眉间皱痕 提交于 2019-11-26 15:27:55
问题 I have developed a photo sharing community site using CodeIgniter 1.7. Photos that are uploaded by members are automatically resized in a number of formats, for which I use the CodeIgniter Image Manipulation class. This class is built into the framework and basically a wrapper around multiple image manipulation libraries, such as GD, GD2, ImageMagick, and NETPBM. On my host, I can only make use of GD2, so that's where this question will be about. On to my problem. Here is an example of a

Convert SVG image to PNG with PHP

时光怂恿深爱的人放手 提交于 2019-11-26 01:28:28
问题 I\'m working on a web project that involves a dynamically generated map of the US coloring different states based on a set of data. This SVG file gives me a good blank map of the US and is very easy to change the color of each state. The difficulty is that IE browsers don\'t support SVG so in order for me to use the handy syntax the svg offers, I\'ll need to convert it to a JPG. Ideally, I\'d like to do this with only the GD2 library but could also use ImageMagick. I have absolutely no clue