psd file upload and creat thumbnail in laravel no sleution found - png

I Have error in code
Intervention\Image\Exception\NotReadableException
Unsupported image type image/vnd.adobe.photoshop. GD driver is only able to decode JPG, PNG, GIF, BMP or WebP files

Related

can a jpeg have an animation?

can someone please tell me how can i make a jpeg like this that is animated
https://oss-pk-arab.badambiz.com/icon_8323870_d2d3b09a2e7a94ea0753b5bdce7f53b3.jpeg
even trying to save it to your pc gets rid of the animation so i suspect its done with code?
can a jpeg have an animation?
Yes: while the JPEG file format (i.e. JFIF) does not support animation or multiple frames, there is "Motion JPEG" which refers to a variety of file-formats based on sequential JPEG image/frames.
However! - The animated image you linked to is actually an animated GIF in disguise: despite the .jpeg filename extension in the URI and the webserver incorrectly serving the image with Content-Type: image/jpeg, if you download the 1.8MB file and use a hex editor, you'll see it's a GIF file, and a GIF editor can reveal the frames:
Visible GIF animation frames in a GIF editor:

iOS PDF with libHaru issue

I use libHary to create PDF.
I use this answer iOS SDK - Programmatically generate a PDF file to create pdf.
In this library method HPDF_LoadPngImageFromFile exist, but I need to load image from data (or UIImage). How can I do that?
Now the best solution for me is to right data to png file and then load it, but I thing better solution should exist.
LibHaru is platform independent so it does not know about about UIImage or NSData.
You have 2 options:
1. Save the UIImage/NSData to a file and then load the image from the file using HPDF_LoadPngImageFromFile method or
2. Save the UIImage to a NSData object, get a pointer to the NSData buffer ([nsdataobject bytes] method) and then use HPDF_LoadPngImageFromMem to load the image from memory.

Is there any gem to read exif data from png images

I am uploading png images from iphone. I would like to read the gps information from the image. I am using EXIF Reader(GitHub) but it works only for gif and tiff format.
Any solution to read Exif data from png images will be useful
exiftool supports PNG, and there are rubygems wrapping it:
multi_exiftool
mini_exiftool
I'm not sure what the difference between these two are, though.
ChunkyPNG supports this
img = ChunkyPNG::Image.from_file('image.png')
p img.metadata

memory leak when JPEG, not when PNG

My application aims at saving some user photos in a PDF file in order to send the file by email. To produce a small size pdf, I want to compress my images in jpeg. When I draw jpeg to the PDF context, the pdf file is indeed much smaller than when I use PNG, but the use of JPEG leaks.
For my debugging I added a jpeg and a png file to my project.
The following call leaks :
UIImage * destImage = [UIImage imageNamed:#"Image.JPG"];
[destImage drawInRect:drawingFrame];
whereas this one does not :
UIImage * destImage = [UIImage imageNamed:#"Image.png"];
[destImage drawInRect:drawingFrame];
Is there something I'm missing ? Is it a know issue ?
I'm thinking about a workaround that would consist in using a PNG representations of my images and set a specific compression option to the pdf I generate, but did not find this in the pdf generation sdk.
Do you have an idea about it ?
Thanks in advance.

Getting UIImage size when Image is picked from Photo Library

In my application I am uploading the image picked from Photo library. before uploading I need to show the size of image so that user will come to know how much data he need to transfer over network.
To Achive this I need to get Image size , I tried with UIImagePNGRepresentation,after this I am getting size in terms of some MBs,but when I dump image with data received from UIImagePNGRepresentation,size is shown in some KBs. why this is happening?
Does iOS internally compress the image data? how to get image path when picking image from photo library?
Thanks,
Sagar