gd

Check image visible quality [PHP]

耗尽温柔 提交于 2019-12-25 05:34:06
问题 I want to make image quality check. Maybe calculate some index of that quality. For example, lets say, user A uploads something like http://www.hyperconectados.com/wp-content/uploads/2014/03/Selfie.jpg and user B uploads something like http://www.privatewifi.com/wp-content/uploads/2014/02/selfie.jpg It's obvious, that B photo is professional and in good quality. There's another thing, that it's not good to use image size and weight(?) because B image could be resized, photoshoped or something

PHP GD (intervention/image) : quality is different depending on the server

有些话、适合烂在心里 提交于 2019-12-25 04:26:11
问题 I use the intervention/image library (which use GD) for my Laravel 4.1 project to resize some images (jpg and png). Everything is great on dev server, but in production, the quality of the thumbnails is very poor. I thought it was a GD problem, but here are the installed versions, and they look similar to me: dev : OSX Mavericks, php 5.4.19 GD Support : enabled GD Version : bundled (2.1.0 compatible) FreeType Support : enabled FreeType Linkage : with freetype FreeType Version : 2.4.10 T1Lib

New lines in a string with GD library

岁酱吖の 提交于 2019-12-25 03:27:18
问题 Is it possible? \n doesnt work, html doesnt work, nothing seems to work. I know I could just make a new string instead, but that is more effort than should be needed for this simple task. How can I do this? 回答1: i think you can't you have to output a new string some pixels lower than the previous. \n won't do a linebreak for you... 回答2: You can't insert line breaks, you can get the bounding box of any truetype font by using the imagettfbbox function. You might want to take a look at the

PHP GD Library cannot Merge to image using function

喜夏-厌秋 提交于 2019-12-25 03:04:33
问题 This is my php class to merge to images mergepic.php class mergepic{ public function merge_barchart_drawing($object,$obj) { $src = imagecreatefrompng($obj->barchart()); $dest = imagecreatefrompng($object->drawing()); //$src = imagecreatefrompng('http://localhost/graph/barchart.php?barchart='.$_GET['barchart'].'&max='.$_GET['max'].'&digit='.$_GET['digit']); //$dest = imagecreatefrompng('http://localhost/graph/drawing.php?drawings='.$_GET['drawings'].'&max='.$_GET['max'].'&digit='.$_GET['digit'

php image steganography nearly same start

折月煮酒 提交于 2019-12-25 02:07:58
问题 i am working on a php-script which encodes given text and hides that in an Image using LSB. But the encoded text is a Byte Array (text encrypted using mcrypt with rijndael-256 and then unpacked with unpack("C*", $encryptedText);) i have tp add the array-size at the beginning of the Array. if i would not do this, reading the Bytes from the Image again would be terrible later on, because the script would not know where to stop reading. I added size Information at the beginning of the Array

PHP - Generate transparency (or opacity) gradient using image

荒凉一梦 提交于 2019-12-25 01:27:03
问题 Using PHP is it possible to take an existing image and produce a copy where the original image changes from 100% opaque to 0% opaque (or 0% transparent to 100% transparent!)? Thanks, Toby EDIT: I realise my question was unclear, apologies. I want to take an image and create an opacity gradient across it, so the image is 100% opaque at the top, 100% transparent at the bottom and translucent in between. 回答1: If you change from 100% opaque to 0% opaque the image wouldn't be visible anymore. What

ie6 - gd and php image outputting

一笑奈何 提交于 2019-12-25 00:52:52
问题 i'm trying to show image with grayscale-filter. Here is my code: $images = glob('gallery/*small*'); shuffle($images); array_splice($images, 3); $imgHandles = array(); $imgBuffered = array(); for( $i = 0; $i < 3; $i++) { $imgHandles[$i] = imagecreatefromstring( file_get_contents($images[$i]) ); imagefilter( $imgHandles[$i], IMG_FILTER_GRAYSCALE ); ob_start(); imagepng( $imgHandles[$i] ); $imgBuffered[$i] = ob_get_contents(); ob_end_clean(); imagedestroy( $imgHandles[$i] ); } And outputting:

How can I correctly configure GD support for PHP? I am getting an error calling imagettfbbox()

主宰稳场 提交于 2019-12-24 23:06:38
问题 Using Symfony2.0 and Gregwar Captcha Bundle for Symfony 2.0 Operating System: Mac OS 10.10 (Yosemite) After having installed the CaptchaBundle following the instructions, the first time I use it, I get the following error: Fatal error: Call to undefined function Gregwar\CaptchaBundle\Generator\imagettfbbox() in /Users/pgbonino/Sites/preparatest/vendor/bundles/Gregwar/CaptchaBundle/Generator/CaptchaGenerator.php on line 176 My phpinfo informs this: <h2><a name="module_gd">gd</a></h2> <table

For loop with imagettftext and array

假装没事ソ 提交于 2019-12-24 21:13:40
问题 I encounter a problem while trying to make a simple text-on-image generator using PHP's GD library. In my form page, I send variables separated by ';' to an array. And then on my image generating page, I want to display my variables from the array separately on my newly created image with a space of 15 px between them. In my FOR loop, PHP functions should calculate the width of the display of each variable separately and the total width of the final image in order to create it. I have tried

Having issues with GD thumbnail generator

三世轮回 提交于 2019-12-24 20:07:59
问题 I'm using PHP to generate thumbnails. The problem is that I have a set width and height the thumbnails need to be and often times the images are stretched. What I'd like is the image to remain at the same proportions and just have black filler (or any color) either on the left & right for tall images or top & bottom for wide images. Here is the code I'm currently using: (dumbed down a bit for readability) $temp_image_file = imagecreatefromjpeg("http://www.example.com/image.jpg"); list($width,