Questions tagged [imagecreatefrompng]

Anything related to imagecreatefrompng PHP function for creating an image from file or URL

imagecreatefrompng is a PHP function that returns an image identifier representing the image obtained from file or URL

109 questions
1
vote
3 answers

Php Image creation and upload to folder

I want to create a image dynamically and upload it to a folder. I will be getting image for body,sleeve,collar and cuff dynamically from user selection. I am merging all these images to create a new image and this new image to uploaded in a folder.…
Mohan
  • 281
  • 2
  • 14
1
vote
0 answers

Image workshop plugin can't find image

I'm using the Image Workshop plugin with composer in codeigniter. http://phpimageworkshop.com/ I've created a helper and linked this to my controller. The helper creates an ID card and then shows it to the user. However when it tries to find the…
Luke.T
  • 600
  • 1
  • 5
  • 24
1
vote
1 answer

How to load and repeat-x an image with php gd?

Suppose i have an image with width 1px and height 40px. I want to load it with lets say imagecreatefrompng and want to x-repeat it, just like css repeat-x. Is this possible with PHP GD?
gadlol
  • 1,343
  • 2
  • 15
  • 24
1
vote
3 answers

How to create PNG thumbnail if "imagecreatefrompng()" fails?

I start to create a PNG thumbnail by using this function: $image = imagecreatefrompng("http://imagenic.net/images/pfujz9j5juav1qrex00.png"); However, it says: 'http://imagenic.net/images/pfujz9j5juav1qrex00.png' is not a valid PNG file It works OK…
Misha Moroshko
  • 166,356
  • 226
  • 505
  • 746
1
vote
0 answers

imagecopy creates a black image

I am creating an image using the following code $src = imagecreatefromjpeg('/var/www/demo/wp-content/plugins/eNewsPaper/menu-pages/newspaper/02_3.jpg'); $dest = imagecreatetruecolor(($_POST['width']*2), $_POST['height']*2); $new_path =…
Rohitashv Singhal
  • 4,517
  • 13
  • 57
  • 105
1
vote
4 answers

Creating thumbnail of smaller size from existing image

I am uploading an image to my folder and I have created a thumbnail from uploaded image. /* save this image to try -- http://images.dpchallenge.com/images_challenge/0-999/319/800/Copyrighted_Image_Reuse_Prohibited_157378.jpg */ $source =…
Hitesh
  • 4,098
  • 11
  • 44
  • 82
1
vote
1 answer

imagecreatefromstring memory leak

Hi I am having an error Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 21944 bytes) when trying to use imagecreatefromstring $imageFile = imagecreatefromstring($image); if ($imageFile !== false) { …
Kiel
  • 483
  • 3
  • 5
  • 18
1
vote
1 answer

PHP createimagefromjpeg() How to include all image types

is there a way that i can use createimagefromjpeg() to save an image from a url but allow all image file types? It seems obvious that createimagefromjpeg only allows jpeg / jpg. Here is my current process: // create the image and save it …
Lovelock
  • 7,689
  • 19
  • 86
  • 186
1
vote
0 answers

imagecreatefrompng image ontop of base image using imagestring

Okay, I want to have a Base image (background.png) 400x400 And An Avatar, 200x200 and put it ontop of the background.png in imagecreatefrompng using imagestring have: http://puu.sh/5KEAG.png want: http://puu.sh/5KEF4.png code so far;
Gav
  • 37
  • 1
  • 1
  • 6
1
vote
0 answers

imagetruecolortopalette ignores color parameter

How do I create an image without losing all the colors? It is creating an image with speckles and changing the color number doesn't make a difference. The PNG image I start with (uploaded via PHP) is much sharper. //Create an image from the…
Don Rhummy
  • 24,730
  • 42
  • 175
  • 330
1
vote
1 answer

imagecreatefrompng() with generated png from a php file

I am getting error with this code header ("Content-type: image/jpeg"); $nomphoto = "antigua.jpg"; // On charge d'abord les images $source = imagecreatefrompng('logo.php'); $destination = imagecreatefromjpeg($nomphoto); $largeur_source =…
Dorian_gd
  • 181
  • 1
  • 13
1
vote
1 answer

Merge two images with GD Library, have 1 repeat in background

I want to take an image that has transparency and then overlay that on top of a 60x60 (arbitrary size) image that repeats for the width and length of the first image... So essentially use image 2 as a repeating background image that image 1 is on…
Vitaliy Isikov
  • 3,647
  • 9
  • 38
  • 46
1
vote
1 answer

How do i get binary data from imagecreatefromjpeg

I'm trying to copy my images to Amazon S3 and it works great if I can pass it the binary data from the image like so: $binary = file_get_contents($image_location); $response = $s3->create_object(AWS_S3_BUCKET, $image_name, array( 'body' => $binary,…
Paul
  • 11,671
  • 32
  • 91
  • 143
1
vote
2 answers

Faster way to read and output images in browser with PHP

I am reading images from minimum of 1x1 pixel to maximum of 1600x1600 pixels. I have written three PHP methods and are working perfectly. // using FGC function output_fgc($filename) { header("Content-Type: image/png"); echo…
Madan Sapkota
  • 25,047
  • 11
  • 113
  • 117
1
vote
0 answers

PHP 5.4.12 Mac OSX imagecreate* functions not working

I am running PHP 5.4.12 from macports on Mac OSX 10.7.5 with Apache 2 (Apache/2.2.24 (Unix) mod_ssl/2.2.24 OpenSSL/1.0.1e DAV/2 PHP/5.4.12). 5 days ago this code worked (yes directly from PHP site):