IMAGECREATEFROMSTRING(3) 1 IMAGECREATEFROMSTRING(3)imagecreatefromstring - Create a new image from the image stream in the stringSYNOPSIS
resource imagecreatefromstring (string $image)
DESCRIPTION imagecreatefromstring(3) returns an image identifier representing the image obtained from the given $image. These types will be automati-
cally detected if your build of PHP supports them: JPEG, PNG, GIF, WBMP, and GD2.
PARAMETERS
o $image
- A string containing the image data.
RETURN VALUES
An image resource will be returned on success. FALSE is returned if the image type is unsupported, the data is not in a recognised for-
mat, or the image is corrupt and cannot be loaded.
EXAMPLES
Example #1
imagecreatefromstring(3) example
<?php
$data = 'iVBORw0KGgoAAAANSUhEUgAAABwAAAASCAMAAAB/2U7WAAAABl'
. 'BMVEUAAAD///+l2Z/dAAAASUlEQVR4XqWQUQoAIAxC2/0vXZDr'
. 'EX4IJTRkb7lobNUStXsB0jIXIAMSsQnWlsV+wULF4Avk9fLq2r'
. '8a5HSE35Q3eO2XP1A1wQkZSgETvDtKdQAAAABJRU5ErkJggg==';
$data = base64_decode($data);
$im = imagecreatefromstring($data);
if ($im !== false) {
header('Content-Type: image/png');
imagepng($im);
imagedestroy($im);
}
else {
echo 'An error occurred.';
}
?>
The above example will output something similar to:[NOT DISPLAYABLE MEDIA]Output of example : imagecreatefromstring()
SEE ALSO imagecreatefromjpeg(3), imagecreatefrompng(3), imagecreatefromgif(3), imagecreatetruecolor(3).
PHP Documentation Group IMAGECREATEFROMSTRING(3)
Check Out this Related Man Page
IMAGE2WBMP(3) 1 IMAGE2WBMP(3)image2wbmp - Output image to browser or fileSYNOPSIS
bool image2wbmp (resource $image, [string $filename], [int $threshold])
DESCRIPTION image2wbmp(3) outputs or save a WBMP version of the given $image.
PARAMETERS
o $
image -An image resource, returned by one of the image creation functions, such as imagecreatetruecolor(3).
o $filename
- Path to the saved file. If not given, the raw image stream will be output directly.
o $threshold
- Threshold value, between 0 and 255 (inclusive).
RETURN VALUES
Returns TRUE on success or FALSE on failure.
EXAMPLES
Example #1
image2wbmp(3) example
<?php
$file = 'php.png';
$image = imagecreatefrompng($file);
header('Content-Type: ' . image_type_to_mime_type(IMAGETYPE_WBMP));
image2wbmp($image); // output the stream directly
imagedestroy($image);
?>
NOTES
Note
WBMP support is only available if PHP was compiled against GD-1.8 or later.
SEE ALSO imagewbmp(3).
PHP Documentation Group IMAGE2WBMP(3)
Hello Folks!
Problem in getting image size by using getimagesize() function in PHP, the function is working fine on windows OS, but returning nothing on Unix OS, Please guide me how I could get image size/dimensions on Unix OS, as long as I have understood the problem, it is basically the path... (1 Reply)
Hi, (HP-UX 11.11)
I need to create a tape image of an igniteUX image created on our igniteUX server.
That is to say. I have a "Online" image of the igniteUX of the targeted system but I now need to copy it to a useable TAPE (igniteUX) image so i can build an other server from it that is not... (3 Replies)
Discussion started by: Andrek
3 Replies
3. Post Here to Contact Site Administrators and Moderators
Hi,
I am unable to view/open the image I uploded in one of the forums.
https://www.unix.com/showthread.php?t=37793&page=2&pp=20
Please help.
enc. (2 Replies)
Hello,
I have an mksysb image in my disk, created like:
# mksysb -i /mnt/backup/lpar2.image
I want to know if this image could be copied to a tape and make it a boot image.
Thanks
Enzote (3 Replies)
if VG_SOURCE_DISK_LIST varaible(value set to = hdisk1 hdisk0 )is set in image.data file when taking mksysb image backup on a source server and if we use this image to install it on a different server(clone). Does it warn during installation on the target server if it doesn't have disks hdisk1 and... (1 Reply)
I 'm new to linux .. can some one tell how can we create a linux image like solaris flash archive and then use it with kickstart server to build multiple clients
from same image ?
Thanks (4 Replies)
I am trying to run an old script to modify an image file with a modified header to bypass the md5 check but it comes up with an error message. The image file is for use on a Expressgate SSD so that I can add sqx files to it. This is a link from where I got the script:-... (3 Replies)
I am pretty new to scripting and i was wondering if anyone could help me out.
Here is the situation. I am trying to make an action folder that when an image is saved to it, the image is automatically moved to a folder based upon the first 4 or 5 integers of the name.
image names come in a... (2 Replies)
Hi Experts,
I am very new to AIX, I have a mksysb image in one of my aix server (V6), I would like to install this mksysb image on newly lpar. Is it possible without tape and NIM?
Advice would be appreciated.
Regards,
Rockie (11 Replies)