gd

Showing geographic location on a world map of a user

我是研究僧i 提交于 2021-02-10 15:49:57
问题 I'm trying to make a simple script that takes lon/lat as an argument and places an dot on a word map image, simple. <?php if(empty($long))$long = 56.946536; if(empty($lat)) $lat = 24.10485; $im = imagecreatefromjpeg("earth_310.jpg"); $red = imagecolorallocate ($im, 255,0,0); $scale_x = imagesx($im); $scale_y = imagesy($im); $pt = getlocationcoords($lat, $long, $scale_x, $scale_y); imagefilledrectangle($im,$pt["x"]-2,$pt["y"]-2,$pt["x"]+2,$pt["y"]+2,$red); header("Content-Type: image/png");

imagettftext and arabic language: how can I write in RTL mode?

≡放荡痞女 提交于 2021-02-08 10:01:49
问题 I need to write in RTL mode to imagettftext, 'caus arabic language is in this way: and I don't mean to revert the letters, I mean a css-like RTL (direction:rtl), so aligned-flag on the right... how can I? My easy code: require('static/I18N/Arabic.php'); $Arabic = new I18N_Arabic('Glyphs'); $font="static/ArabicModern-Light.ttf"; $testo=$Arabic->utf8Glyphs($testo); imagettftext($im, 26, 0, 560, 345, $textcolor, $font, "\"".$testo."\""); Thanks! 回答1: After eventually finding and downloading Ar

Is imagedestroy() required when you only process a single image?

此生再无相见时 提交于 2021-02-07 14:22:22
问题 I'm using PHP to process some image using GD extension. The code structure is rather complicated, images are allocated "deep" in the code and there are many IF's that simply bail-out. The script only processes a single image, and once it writes it to the file it exits. I guess I could use try...catch instead, but I'm interested to know whether it is really needed to call imagedestroy() or PHP's garbage collector would free it when script ends? 回答1: No, you don't need to call this function,

Is imagedestroy() required when you only process a single image?

徘徊边缘 提交于 2021-02-07 14:21:28
问题 I'm using PHP to process some image using GD extension. The code structure is rather complicated, images are allocated "deep" in the code and there are many IF's that simply bail-out. The script only processes a single image, and once it writes it to the file it exits. I guess I could use try...catch instead, but I'm interested to know whether it is really needed to call imagedestroy() or PHP's garbage collector would free it when script ends? 回答1: No, you don't need to call this function,

PHP - How to write image resource to file

孤街浪徒 提交于 2021-02-07 11:26:40
问题 I used function imagecopyresampled to cropping image. I tried use file_put_contents and fwrite to write the resized_image to file on hard disk but all attempts were failed. Can I write the resized image to disk instead of using imagejpg to print it out to browser? 回答1: Here's the function signature for imagejpeg(): bool imagejpeg ( resource $image [, string $filename [, int $quality ]] ) So, provide your destination filename as the second argument. (Standard filesystem permission warnings

Extension gd is missing from your system - laravel composer Update

守給你的承諾、 提交于 2021-02-05 14:29:51
问题 I newly install Dompdf in Laravel Project via Composer ( composer require barryvdh/laravel-dompdf ). After enter the Command Terminal Reply Following Errors. Problem 1 - dompdf/dompdf v0.7.0 requires ext-gd * -> the requested PHP extension gd is missing from your system. - barryvdh/laravel-dompdf v0.7.0 requires dompdf/dompdf ^0.7 -> satisfiable by dompdf/dompdf[v0.7.0]. - Installation request for barryvdh/laravel-dompdf ^0.7.0 -> satisfiable by barryvdh/laravel-dompdf[v0.7.0]. To enable

php gd imagerotate fails when -1 is passed for $bgd_color

倖福魔咒の 提交于 2021-02-05 06:11:10
问题 I had this problem on a client server $tmp = imagerotate($tmp, $angle, -1); $tmp => bool(false) with no error message displayed $tmp = imagerotate($tmp, $angle, imagecolorallocatealpha($tmp, 0, 0, 0 , 127)); this works fine $tmp => resource(89) of type (gd) What server configuration variable should be changed to make -1 work ? GD Version: bundled (2.1.0 compatible) libPNG Version: 1.2.44 回答1: "What server configuration variable should be changed to make -1 work?" There is no server

php gd imagerotate fails when -1 is passed for $bgd_color

﹥>﹥吖頭↗ 提交于 2021-02-05 06:10:25
问题 I had this problem on a client server $tmp = imagerotate($tmp, $angle, -1); $tmp => bool(false) with no error message displayed $tmp = imagerotate($tmp, $angle, imagecolorallocatealpha($tmp, 0, 0, 0 , 127)); this works fine $tmp => resource(89) of type (gd) What server configuration variable should be changed to make -1 work ? GD Version: bundled (2.1.0 compatible) libPNG Version: 1.2.44 回答1: "What server configuration variable should be changed to make -1 work?" There is no server

php gd imagerotate fails when -1 is passed for $bgd_color

非 Y 不嫁゛ 提交于 2021-02-05 06:10:24
问题 I had this problem on a client server $tmp = imagerotate($tmp, $angle, -1); $tmp => bool(false) with no error message displayed $tmp = imagerotate($tmp, $angle, imagecolorallocatealpha($tmp, 0, 0, 0 , 127)); this works fine $tmp => resource(89) of type (gd) What server configuration variable should be changed to make -1 work ? GD Version: bundled (2.1.0 compatible) libPNG Version: 1.2.44 回答1: "What server configuration variable should be changed to make -1 work?" There is no server

Displaying an image created with imagecreatefromstring

跟風遠走 提交于 2021-02-04 15:00:54
问题 Let's say I have the code that looks something like: <?PHP // //... stuff here // $im = imagecreatefromstring( $imageData ); echo "<img src=" . /* what goes here? */ . "alt=\"the image\" />"; // // more stuff here // ?> What do I replace /* what goes here? */ with so my image data will display? Thank you. 回答1: What do I replace /* what goes here? */ with so my image data will display? The location you highlighted is the so called src attribute of the img HTML-tagDocs. The value is a so called