I want to certificate a PDF File with Laravel and sign it with two signatures (one of the employee and one of the recruiter). I tried TCPDF Library with slef-signed certificate (generated with openssl) but the pdf generated was not certified, also I can't add image in pdf, an error was occured : TCPDF ERROR: TCPDF requires the Imagick or GD extension to handle PNG images with alpha channel. I try to solve it with adding Imagick to xampp but it's not solved .
Any suggestions to certifcate the pdf and sign it with multiple signatures !?
Add to your php.ini file this extensions.
extension=php_imagick.dll
extension=php_gd2.dll
Unix
extension=imagick.so
After checked about 20 solutions I gave up and need help.
I've got 2 JPG files. Both have proper mime, they are not too big for upload_max_filesize, names are ok, path is ok. Every solution was about one of those issues.
My problem is when I run script on first image it is ok, no error, object is created:
$image1 = Image::make(public_path()."/uploads/goodimage.jpg");
See example:
https://app.esticrm.pl/uploads/goodimage.jpg
When I run it on other picture I'm getting error:
$image2 = Image::make(public_path()."/uploads/badimage.jpg");
See example:
https://app.esticrm.pl/uploads/badimage.jpg
Error message:
Intervention \ Image \ Exception \ NotReadableException Unsupported
image type. GD driver is only able to decode JPG, PNG, GIF or WebP
files.
Same situation on Windows and Linux. Files are opening on every graphic program and browser I've checked.
Those problems has started after PHP upgrade from 5.5.x to 5.6.35. Was fine before.
Ok, I found solution:
$image2 = Image::make(file_get_contents(public_path()."/uploads/badimage.jpg"));
Works also on file object from form:
$image2 = Image::make(file_get_contents(Input::file('upload_file'));
I had the same problem and my way of solving was the next.
I had to change the size that nginx allowed the user to upload in /etc/nginx.conf, like this:
http {
client_max_body_size 100M;
}
And I had to change also my php.ini, to increase the size of the files uploaded and the total size:
upload_max_filesize = 4M
post_max_size = 16M
I hope helps someone
change following variables in php.ini file
post_max_size = 128M
upload_max_filesize = 128M
print phpinfo() to find your php.ini location.
If its cpanel its under software section->php versions-> click on "Switch To PHP Options" . Then change the value.
Also change the max_execution_time to 600
if you are downloading remote image and use it with Image::, make sure that image is downloaded correctly. Sometimes when you are using file_get_contens(), image will not be downloaded or it will have size 0.
So better way to download remote image is to use CURL, but in this case you have to be sure that remote url is https
$content = $this->url_get_contents(str_replace('http://','https://',$remote_img_path));
where url_get_contents() is curl to get remote image
as explained on floyk.com:
https://floyk.com/en/post/laravel-unsupported-image-type-gd-driver-is-only-able-to-decode-jpg-png-gif-or-webp-files
The error message "Unsupported image type image/tiff" means that the GD library being used by the Intervention Image library does not support TIFF images. The GD library is a graphics library for PHP that provides image manipulation functionality, and it only supports a limited number of image formats.
To convert a TIFF image to a PNG image, you will need to use a different library or tool that supports TIFF images. One option is to use the Imagick PHP extension, which provides a set of functions for working with images and supports a wider range of image formats, including TIFF.
To use the Imagick extension, you will first need to install it on your server and then update your code to use the Imagick functions instead of the GD functions. Here is an examp…
$imagick = new Imagick();
$imagick->readImage('input.tif');
$imagick->setImageFormat('png');
$imagick->writeImage('output.png');
Alternatively, you could use a command-line tool like ImageMagick to convert the TIFF image to a PNG image. You can then use the PHP exec() function to call the ImageMagick command from your PHP code.
exec('convert input.tif output.png');
example :
Image files do not work when loaded using the method
response()->download(public_path('/users/').$attachment->path) ;
The error I get is
Could not load image 'name.jpeg'
The error you say is different than the error in the image. Are you sure the jpeg is not corrupted? Can you open the image in other program? And verify the file is located in
/public/users/name.jpeg
I try to upload gif from admin panel of Magento2 for a feature, but it is not looping gif but a jpg at the frontend.
Looking for your advices which is also ok for Cache
Why dosent the uploaded Gif animated ? why isnt it looping ?
When you upload images to Magento i the Wysiwyg editor. it "prepares" your images for frontend. By doing so a version of the image is stored in cache preparation.
The function that handles this is not compatible with the .gif format, and therefore i takes the first image in the row of images contained in the .gif file.
You can upload you image with a FTP client like Filezilla or through Cpanel, and overwrite the gif you already uploaded. that way the function is not run on your file, and you will keep your animated image.
There is also modules that makes the Wysiwyg editor compatible with the .gif format, for more permanent soloutions.
I am using eclipse & JDE to develop Blackberry Application. I compressed a folder which has set of images in .jpg and .png formats. Please help me, how to retrieve images form the zipped file?
Thank you.....
I can't see any reason to compress compressed graphic format. Anyway it can't be efficient. It's better to add all images to progect img folder and use them as a resources from code:
Bitmap bmp = Bitmap.getBitmapResource("image.png");