gdlib

Resize image using PHP if it's too small

喜你入骨 提交于 2019-12-12 19:58:43
问题 I'm allowing user uploads, and I want to scale their images up if they're too small (low quality is a non-issue). I need to make the smallest side become 150px and have the other dimension scale up to keep the aspect ratio. I need to make it work for .jpg, .gif and .png files. Any pointers would be greatly appreciated, I'm struggling to find anything about making images larger like this. 回答1: As answered here, give it a try to WideImage. 回答2: Thanks to Alexander for the WideImage suggestion.

When dealing with GD Library unwantedly altering colors

倾然丶 夕夏残阳落幕 提交于 2019-12-12 05:13:39
问题 I'm merging multiple small images into a rectangular mosaic. When dealing with a small number of source images it turns out fine: But when dealing with a larger number of sources it turns out a sepia like effect: Is there any technique I should be used to preserve the colors? My method for merging the images is essentially running a script that loops through the source images using imagecreatefromjpeg() to grab it, followed by imagecopy() to merge the source onto the collective destination

How to use/link gdLibrary (libgd) with MS Visual C++ (e.g. 2008 Express Edition)? Getting LNK2019 errors

若如初见. 提交于 2019-12-12 00:38:26
问题 I have to use the gdLibrary (http://www.libgd.org) in a C++ App on MS Windows XP Prof. SP3 32bit - and I'm trying and googleing for two days now without success. Does anyone of you use libgd with MS VC++ 200x EE? My problem: It has to to compile with MS Visual C++ (e.g. the 2008 Express Edition - fixed 3rd party condition)... but currently the linker crashes, with 11 of the following LNK2019 errors: Linking... codereate.obj : error LNK2019: An undefined external symbol "_gdImageDestroy" was

How to make fade edges in image magic?

时光总嘲笑我的痴心妄想 提交于 2019-12-11 04:54:56
问题 I want to create faded edges image effect using imagemagic commands. Please help me for a command to make effect as like http://postimg.org/image/h51e4twyp/ 回答1: Start with Doge curl -o doge.jpg http://i0.kym-cdn.com/photos/images/newsfeed/000/581/296/c09.jpg Next, blur the edges. convert doge.jpg -alpha set -virtual-pixel transparent -channel A -morphology Distance Euclidean:1,20\! +channel doge.png You will need to output it as a .png Imagemagick documentation Edit : The above example is

Radial gradients with opacity in PHP

对着背影说爱祢 提交于 2019-12-10 09:52:00
问题 I need to create a PNG radial gradient with opacity. I've looked through GDLib but I can't see a way to generate radial gradients. Does anyone know of a way with GDlib or any other graphics library for PHP? I suppose worst-case I could generate it pixel-by-pixel using GDLib but how does one even start to do the math on that? The goal is to generate sexy lighting effect background PNGs for web pages. An example of the effect can be seen on the header here which uses this background image. I've

Image curving with PHP or HTML5

故事扮演 提交于 2019-12-10 09:07:32
问题 I am looking to achieve: http://i53.tinypic.com/2gule04.jpg I have tried the answers mentioned at Curving an image that starts as a rectangle (uploaded by user), preferably using Canvas or JS Based on the answers there, I have tried pixel wise transformation which didn't work. To understand a mesh based approach, you will need a skill set of 3d-2d developer which I don't possess. I am a PHP developer and I am looking for an answer in either PHP or HTML5. I have tried number of things ranging

Using the PHP GD library to resize and save images is HELL

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-10 09:00:32
问题 I'm writing a script that will upload a file from user input, resize it to a thumbnail and add the two new filenames to a database. However, I cannot for the life of me figure out how to get PHP to detect the image's MIME type and then give it to the header. Here is the code, I've put comments to try and make it as clear as possible: $picture = $_FILES['picture']['name']; /*original file location*/ $file = 'picture/'.$picture.''; /*save thumbnail location*/ $save = 'thumb/tn-'.$picture.''; /

Is there a way to output html div to an image using php?

自古美人都是妖i 提交于 2019-12-08 12:35:37
问题 I have a div on my page which I want to output to a jpeg file. Is this possible using PHP? I know there's the GD library for creating images in PHP but I'm not sure if it can do what I want. Because I also want to put a barcode on the image (I used a jQuery plugin to do this on the html page) . Is this possible (if it's possible can you give me an idea how to implement it) or is there a better approach to this? Thanks! 回答1: As far as I know the functionality you want is not supported by GD.

php mosaic script

房东的猫 提交于 2019-12-08 12:15:51
问题 I'm using a script that I downloaded from google code to dynamically generate mosaic images with the GD library. The script seems a bit convoluted. I've messed around with it quite a bit, but I'm sort of confused since it's written in German and I don't speak deutsch. I know that in order for it to work, I need to have 121 different images. But, I'm not sure if they needs to be in the directory or in mysql. Does anyone have a clue as to how to use this? Or does anyone have some suggestions

Extract words from an Image and PDF - Laravel [closed]

安稳与你 提交于 2019-12-06 11:56:36
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 years ago . is there any way to extract words from scanned images and PDF? Is there any such library for Laravel as I want to use it for laravel. I have searched a lot for that but did not found any such thing for Laravel. Please let me know if you are aware about it. Every help would be highly appreciated :-). Thanks to