The simplest way to do this is let php decide what is the file type:
$image = imagecreatefromstring(file_get_contents($src));
More Related Contents:
- Efficient JPEG Image Resizing in PHP
- Creating a thumbnail from an uploaded image
- Compare 2 images in php
- How to add text to an image with PHP GD library
- php GD create a transparent png image
- Convert tiff to jpg in php?
- Crop whitespace from image in PHP
- How to install Imagick/imagemagick PHP extension on windows 7
- Cropping image in PHP
- Working with GD ( imagettftext() ) and UTF-8 characters
- Merge two PNG images with PHP GD library
- Merge two images in php
- How to convert an image to Base64 encoding
- I need my PHP page to show my BLOB image from mysql database
- php: recreate and display an image from binary data
- PHP check if file is an image [duplicate]
- Check whether image exists on remote URL
- Can I embed a .png image into an HTML page?
- php link to image file outside default web directory
- Send email with PHPMailer – embed image in body
- How to get the browser to cache images, with PHP?
- Loop code for each file in a directory [duplicate]
- PHP GD Use one image to mask another image, including transparency
- Crop or mask an image into a circle
- Resize images with PHP
- install php70-gd on ubuntu
- I have a base64 encoded png, how do I write the image to a file in PHP?
- Convert HTML to Image in PHP without shell
- PHP – Create simple animated GIF from two JPEG images? [closed]
- PHP allocate color without image resource