gdlib

Ida pro gragh output batch mode

情到浓时终转凉″ 提交于 2019-11-28 10:53:53
问题 Can anyone let me know how we are going to output all the subroutine's graphs in batch mode suing IDC . i.e. I have 447 subroutine's and wanna be output them all and I would like to make sure I first retrieve all the routines address automatically, cuz by knowing the address I can simply use GenFuncCall . P.S: Is this the only cfg that I can get from Ida Pro given a binary dis-assembled file? 回答1: If you just want the address of all known functions in the IDB, you could use something like

How would I skew an image with GD Library?

ⅰ亾dé卋堺 提交于 2019-11-27 23:20:31
I want to skew an image into a trapezoidal shape. The left and right edges need to be straight up and down; the top and left edges need to be angular. I have no idea what the best way to do this is. I'm using GD Library and PHP. Can anyone point me in the right direction? Thanks, Jason Try this: <? // Set it up $img_name = "grid.jpg"; $src_img = imagecreatefromjpeg($img_name); $magnify = 4; // Magnify the size $w = imagesx($src_img); $h = imagesy($src_img); $dst_img = imagecreatetruecolor($w * $magnify, $h * $magnify); imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $w * $magnify, $h *

PHP+GD: imagecopymerge not retaining PNG transparencies

ぃ、小莉子 提交于 2019-11-27 18:44:06
问题 I have two PNG files, "red.png" and "blue.png"; they are both mostly transparent, but there is a few pixels of red or blue splotches in various places. I want to make a PHP script that merges the two; it should be as simple as something like: $original = getPNG('red.png'); $overlay = getPNG('blue.png'); imagecopymerge($original, $overlay, 0,0, 0,0, imagesx($original), imagesy($original), 100); header('Content-Type: image/png'); imagepng($original); When I run this script, all I get is the

Rendering an SVG file to a PNG or JPEG in PHP [duplicate]

拟墨画扇 提交于 2019-11-27 13:42:51
This question already has an answer here: Convert SVG image to PNG with PHP 8 answers I've googled as much as I can, but I've only found a PHP class that calls upon Inkscape to render the SVG, so I ask here: I have a valid SVG file generated in some way (or uploaded by a client). I need to render this into a JPG or PNG using just PHP and/or GDLib, as SVG is not supported by all browsers. I do not have the option of installing anything, so a class that converts SVG to PNG using GDLib would be the most ideal. David Z. Check if ImageMagick is installed (you can find out using phpinfo ). If it is,

Find JPEG resolution with PHP

此生再无相见时 提交于 2019-11-27 12:35:51
问题 Calling all PHP gurus! I understand that you can use getimagesize() to get the actual pixel height and width of an image in PHP. However, if you open an image in photoshop and look at the image size dialog, you notice that there is a resolution value that determines the print size of the image. Given an arbitrary jpg image file, I need to use PHP to determine this resolution number. It appears that this information is stored in the jpg file somewhere, so how do I get to it? One other

how to create a base64encoded string from image resource

梦想的初衷 提交于 2019-11-27 05:24:07
I have sent a base64 encoded string via AJAX to PHP and created an image resource with imagecreatefromstring - all is fine. Now I want to get the base64 encoded string after resizing te image, but i CANT find a function to get the base64encoded string. Taken from http://www.php.net/manual/en/book.image.php#93393 $image = imagecreatefromstring($file); // start buffering ob_start(); imagepng($image); $contents = ob_get_contents(); ob_end_clean(); echo "<img src='data:image/png;base64,".base64_encode($contents)."' />"; imagedestroy($image); 来源: https://stackoverflow.com/questions/8502610/how-to

How would I skew an image with GD Library?

半世苍凉 提交于 2019-11-26 21:24:48
问题 I want to skew an image into a trapezoidal shape. The left and right edges need to be straight up and down; the top and left edges need to be angular. I have no idea what the best way to do this is. I'm using GD Library and PHP. Can anyone point me in the right direction? Thanks, Jason 回答1: Try this: <? // Set it up $img_name = "grid.jpg"; $src_img = imagecreatefromjpeg($img_name); $magnify = 4; // Magnify the size $w = imagesx($src_img); $h = imagesy($src_img); $dst_img =

Rendering an SVG file to a PNG or JPEG in PHP [duplicate]

南笙酒味 提交于 2019-11-26 18:19:55
问题 This question already has answers here : Convert SVG image to PNG with PHP (8 answers) Closed 5 years ago . I've googled as much as I can, but I've only found a PHP class that calls upon Inkscape to render the SVG, so I ask here: I have a valid SVG file generated in some way (or uploaded by a client). I need to render this into a JPG or PNG using just PHP and/or GDLib, as SVG is not supported by all browsers. I do not have the option of installing anything, so a class that converts SVG to PNG

how to create a base64encoded string from image resource

倖福魔咒の 提交于 2019-11-26 12:32:06
问题 I have sent a base64 encoded string via AJAX to PHP and created an image resource with imagecreatefromstring - all is fine. Now I want to get the base64 encoded string after resizing te image, but i CANT find a function to get the base64encoded string. 回答1: Taken from http://www.php.net/manual/en/book.image.php#93393 $image = imagecreatefromstring($file); // start buffering ob_start(); imagepng($image); $contents = ob_get_contents(); ob_end_clean(); echo "<img src='data:image/png;base64,"