php-gd

How to Crawl a PHP generated image

安稳与你 提交于 2020-01-07 08:29:35
问题 I have a website textscloud.com In this website i make the image with the PHP GD library. Here is a link to a demo: In this page i allow the user to download the image on which text will pe printed. download link is like This download.php file has a header for making the image with PHP GD Library and download the file like this header("Content-type: image/png"); But google didn't crawl these images. Does anyone know the solution? I can't store these image in server. 回答1: You don't mention how

php imagerotate() ruins alpha on png?

爱⌒轻易说出口 提交于 2020-01-04 04:28:05
问题 I've been bashing my head agains something simple.. // ....all prev code is fine.... $pasteboard =imagecreatetruecolor($imgs['bg']["width"],$imgs['bg']["height"]); imagealphablending($pasteboard, false); imagecopyresampled($pasteboard, $imgs['bg']["img"],0,0,0,0,$imgs['bg']["width"],$imgs['bg']["width"],imagesx($imgs['bg']["img"]),imagesy($imgs['bg']["img"])); imagecopyresampled($pasteboard, $imgs['photo']["img"],20,20,0,0,$imgs['photo']["width"],$imgs['photo']["width"],imagesx($imgs['photo']

What's wrong with imagecreatefromstring function?

ε祈祈猫儿з 提交于 2020-01-02 06:12:52
问题 What is wrong with this code? <?php $data = "iVBORw0KGgoAAAANSUhEUgAAAuwAAAUeCAYAAAAl3WRgAAAgAElEQVR4Xuzdz6/vCV3f8TPADIozowg1ETZ2U2Chm6oLuqkdE1clSlzVdEhXLuAPKPwB1X110ZWBpqyMGLoiAe3KRa2bshDclE0xqSDlp4woej5nPJczd+bOmTmv+2Q+d+ZxEkPC3Pfrfs/je0ye8+V7v/exn/rNL/zDhS8CBAgQIECAAAECBE4p8JhgP+Xz4kERIECAAAECBAgQuBIQ7H4QCBAgQIAAAQIECJxYQLCf+Mnx0AgQIECAAAECBAgIdj8DBAgQIECAAAECBE4sINhP

PHP GD-library installed but not functioning on CentOS 6.4

走远了吗. 提交于 2019-12-30 06:34:10
问题 I've installed php 5.5.6 from remi repo, bun phpinfo() shows no GD library and gd_info() function does not exist. Extension is enabled in /etc/php.d/gd.ini , but still nothing. I've also tried to reinstall php-gd library and it reinstalled successfuly but everything remained as it was before. yum --enablerepo=remi,remi-php55 reinstall php-gd Loaded plugins: fastestmirror Setting up Reinstall Process Loading mirror speeds from cached hostfile * base: mirrors.supportex.net * epel: mirror

Transparent PNG over JPG in PHP

与世无争的帅哥 提交于 2019-12-29 08:52:13
问题 What seems to be simple, isn't :( I'm trying to add something like a watermark (transparent png) on an image (jpg). This is the code I'm using: $width = 800; $height = 600; $bottom_image = imagecreatefromjpeg("portrait1.jpg"); $top_image = imagecreatefrompng("man2.png"); imagesavealpha($top_image, true); imagealphablending($top_image, true); imagecopy($bottom_image, $top_image, 200, 200, 0, 0, $width, $height); header('Content-type: image/png'); imagepng($bottom_image); When I merge the

Transparent PNG over JPG in PHP

核能气质少年 提交于 2019-12-29 08:52:09
问题 What seems to be simple, isn't :( I'm trying to add something like a watermark (transparent png) on an image (jpg). This is the code I'm using: $width = 800; $height = 600; $bottom_image = imagecreatefromjpeg("portrait1.jpg"); $top_image = imagecreatefrompng("man2.png"); imagesavealpha($top_image, true); imagealphablending($top_image, true); imagecopy($bottom_image, $top_image, 200, 200, 0, 0, $width, $height); header('Content-type: image/png'); imagepng($bottom_image); When I merge the

Convert HTML to image in php

十年热恋 提交于 2019-12-29 01:24:38
问题 I have to create a PNG / JPEG image from PHP script .. Briefly The code will create a html table and will include an image in that page. I need to save this entire page as an image , save that image in my server and return the path of the image ( using webservice ). I can create image from imagejpg function pretty well . My problem is how to convert that HTML to image, Cant take a screen shot because the processes going on through web services . Please help me to convert HTML to image using

How to use PHP GD to create 1 bit bitmaps (black and white only, no gray)

笑着哭i 提交于 2019-12-24 10:55:32
问题 My goal I have an existing PNG. It currently has anti-aliasing, or in other words, shades of gray. I want the image to be 1 bit, or in other words, only using the colors black and white. My aim is to do this with PHP GD. I have to do this with an existing image, and can not create the image from scratch using imagecreatetruecolor. What I'm trying The function I've found that seems best for the job is imagetruecolortopalette http://php.net/manual/en/function.imagetruecolortopalette.php Here is

install php-gd ext on Debian

邮差的信 提交于 2019-12-24 08:12:13
问题 I'm not able to install php-gd extension on my server. I have php 7.2: PHP 7.2.10-1+0~20181001133426.7+jessie~1.gbpb6e829 (cli) (built: Oct 1 2018 13:50:53) ( NTS ) and debian 8 linux: Debian GNU/Linux 8 command to install GD extension: sudo apt-get install php7.2-gd and result: Reading package lists... Done Building dependency tree Reading state information... Done The following packages were automatically installed and are no longer required: libc-ares2 libnfsidmap2 libpcre16-3 libpcre32-3

Merge two images and round corner in PHP

一世执手 提交于 2019-12-24 01:40:35
问题 I want to round first image and merge it with second. Here is a two images which I want to merge. First image which I want to round in circle. second image where I wan to merge first image Here is a code which I'm using for this purpose. <?php $srcImg = '1.jpg'; $destImg = '2.jpg'; $dstX = 300; $dstY = 40; $srcX = 0; $srcY = 0; $srcW = 200; $srcH = 226; $pct = 100; $dest = imagecreatefromjpeg($destImg); $src = imageCreateCorners($srcImg,200); imagealphablending($dest, false); imagesavealpha(