Because this shop is an eCommerce it helps a lot to have picture with EXIF data, but for some reason when the images with EXIF data is uploaded magento seems to strip all of that info from the image and only show the bare image in the front end.!
can anyone tell me why this is happening and how we can avoid it?
Cheer!
It's a side effect of using the GD2 library for resizing.
lib/Varien/Image/Adapter/GD2.php
See if there's a module out there that uses ImageMagick if you want to preserve EXIF
Quote from PHP website on using GD:
When developing code to resize images, it is best not to use GD. When
using the current GD methodologies, you are reading content from an
image and manipulating it. By then writing that content to a brand
new file, you are losing the EXIF data.
For purposes when you want to retain EXIF data, it is recommended that
you compile in and use the PECL Imagemagick extension. It has great
resizing methods built right in and the EXIF data is retained.
ImageMagick isn't used because of issues with server loading.
Related
As we all know, it is possible to add/edit effect on a image using php. But can we also do the same thing for a video? I have done some searching for this but no results.
I am giving a link which shows how to show effects on an image and which is working fine, but what about video?
You can do this image effects with GD library.
PHP is not limited to creating just HTML output. It can also be used
to create and manipulate image files in a variety of different image
formats, including GIF, PNG, JPEG, WBMP, and XPM. Even more
convenient, PHP can output image streams directly to a browser. You
will need to compile PHP with the GD library of image functions for
this to work. GD and PHP may also require other libraries, depending
on which image formats you want to work with.
But unfortunately there is no library available in php to Video accessing and adding effects.
I am working on a website for my client in which tiff images need to converted to png or jpg before they are assembled into a PDF.
I have read many articles, here and other sites, on this issue. They all recommend using Imagick to accomplish this. The problem is, my client's server does not have that extension installed, and the hosting company is unwilling to install the extension.
Nor is PDFLib installed on the server (which supports importing tiffs into a PDF).
Thanks.
This is tricky because of the tiff format. You can do this for most input formats with native PHP functions to create an image object from the source file and then save that using imagejpeg or imagepng. But tiff has patent issues and I don't think it's supported. Have a look at the PHP GD and image functions available on your server. May be some help in the comments here: http://php.net/manual/en/function.pdf-open-image-file.php
How do I get a coordinate (x,y) of an image from the PDF file using PHP?
For example, I have a PDF document page, I know the size of the page, there I have one image, I know its size too (because I've extracted it using the pdfimages tool). However, I need to know where was this image situated on the page.
I've read that it maybe could be done using FPDF but I couldn't understand how.
To get PDF images with their coordinates, ImageData and size informations, you have to get PDFlib You can get the PECL free version here and TET (Text Extraction Toolkit) here.
After configuring PDFlib and TET and linking both of them to your php's extension on the php.ini (extension=pdf.so and extension=php_tet.so), you will have a bunch of examples in the directory where you installed PDFlib (where you typed ./configure && make && make install or where you get the "php_tet.so"). Open them to see how to use the functions. This lib is object oriented.
With it you can get all the images (coordinates, size and create a jpeg file) and texts (size, font and coordinates) of each pages of a PDF.
I'm at your service if you have other questions or if a point is not clear to you ;)
P.S Sorry my english is not very good
An option would be to convert your pdf to an image (there are scripts available to do so, didn't try it but this might do the job)
Then you can use the code I posted on your other question to locate an image inside another image.
With PHP i'm creating an image with embedded content (base64 encoded files). If i see it using Firefox, or downloading it and then opening it with Inkscape (www.inkscape.org), the image is fine!.
But when i try to convert it using imagemagick (using convert command or with Imagick support for PHP) the embedded image doesn't come in with the final result.
I don't know if there is a special command or configuration i'm missing. I'm not using any special setup. Just ...
convert image.svg image.png
Thank you very much for your answer.
ImageMagick's built-in SVG rendering is really pretty horrible. Don't use it if you can avoid it. I'd recommend using librsvg instead, either using the command-line rsvg tool, or possibly with the PHP rsvg extension.
(Librsvg's rendering isn't always perfect either, but it should be able to handle embedded images just fine. If you want even better rendering, you could always try using Inkscape from the command line.)
Is the embedded image in PNG or in Jpeg format? What converter is used in PHP? I tried on Windows with latest ImageMagick, which doesn't come with RSVG. I found a RSVG-Converter build for Windows, and, while it does a good job, it skips the Jpeg version of the image of a test file.
On the other hand, the built-in converter handles correctly both images, but does an awful job on the home image shown in the SVG tutorial.
Do you know any PHP library that can work with the metadata of an image (author, copyright info, location... etc) and also do resizing and cropping? I use ImageMagick but I couldn't find anything about retrieving and working with metadata of an image.
Thanks
imagemagick. For metadata check here
http://www.imagemagick.org/discourse-server/viewtopic.php?f=2&t=8906
You are looking for
Exif
GD