Convert unsupported image formats

Description

Background

Customers can upload .TIFF files, but they cannot be displayed at this point. Not in Integrated and not in the front-end. The wish of a customer is to support the displaying of this type images.

Requirements

In the thumbnailer, and only if the "imagick" PECL extension is available:

  • Support on the fly conversion with imagemagick for all thumbnails / resized images
    In the integrated_image_dropzone formtype:

  • Try if it is supported by the thumbnailer, including the use of imagick (when available) (event). If not the form is not valid.

Test scenarios

With Imagick extension:

  • Uploading a .png file should result in a displayed image and a storage object with the .png file in it, Imagick is not used

  • Uploading a .tiff file should result in a displayed image and a storage object with the .tiff file in it

  • Uploading a "mygames.ramsaydash" file should raise a validation error
    Without imagick extension:

  • Uploading a .tiff file should raise a validation error

  • Uploading a "mygames.ramsaydash" file should raise a validation error

  • Uploading a .png file should result in a displayed image and a storage object with the .png file in it

Technical tasks

None

Deployment actions

Add to your app/kernel.php the following line: new Integrated\Bundle\ImageBundle\IntegratedImageBundle(),

Activity

Show:
Marijn Otte
January 25, 2017, 3:47 PM

The ImageBundle is not loaded in AppKernel in the skeleton. This raises an error now. All changes to the skeleton should also be mentioned as a deployment action.

[Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException]
The service "integrated_storage.form.type.image_dropzone" has a dependency on a non-existent service "integrated_image.container_converter".

Marijn Otte
January 25, 2017, 4:09 PM

On an installation without ImageMagick bundle uploading a jpg is not possible: "Only Images are allowed to be uploaded.".

Also make sure jpg, gif and png are already supported by default, do they shouldn't be converted.

Marijn Otte
January 26, 2017, 1:15 PM

I also noticed this error:
( ! ) Deprecated: Non-static method Imagick::queryformats() should not be called statically, assuming $this from incompatible context in /vagrant/vendor/integrated/image-bundle/Converter/Adapter/ImageMagickAdapter.php on line 75

Marijn Otte
January 27, 2017, 10:26 AM

Pushing a storage object to the image function seems to be broken now:
[2017-01-27 10:24:58] php.DEBUG: exif_imagetype(/vagrant/app/../web//vagrant/app/cache/dev/integrated/storage/file/06/9c/069c4da0c52b3cccff824f260920d482.jpg): failed to open stream: No such file or directory {"type":2,"file":"/vagrant/vendor/gregwar/image/Gregwar/Image/Source/File.php","line":32,"level":28928} []
[2017-01-27 10:24:58] php.DEBUG: exif_imagetype(/vagrant/app/../web//vagrant/app/cache/dev/integrated/storage/file/06/9c/069c4da0c52b3cccff824f260920d482.jpg): failed to open stream: No such file or directory {"type":2,"file":"/vagrant/vendor/gregwar/image/Gregwar/Image/Source/File.php","line":32,"level":28928} []
[2017-01-27 10:24:58] php.DEBUG: imagecreatefromjpeg(/vagrant/app/../web//vagrant/app/cache/dev/integrated/storage/file/06/9c/069c4da0c52b3cccff824f260920d482.jpg): failed to open stream: No such file or directory {"type":2,"file":"/vagrant/vendor/gregwar/image/Gregwar/Image/Adapter/GD.php","line":527,"level":28928} []
[2017-01-27 10:24:58] php.DEBUG: exif_imagetype(/vagrant/app/../web//vagrant/app/cache/dev/integrated/storage/file/06/9c/069c4da0c52b3cccff824f260920d482.jpg): failed to open stream: No such file or directory {"type":2,"file":"/vagrant/vendor/gregwar/image/Gregwar/Image/Source/File.php","line":32,"level":28928} []
[2017-01-27 10:24:58] php.DEBUG: exif_imagetype(/vagrant/app/../web//vagrant/app/cache/dev/integrated/storage/file/06/9c/069c4da0c52b3cccff824f260920d482.jpg): failed to open stream: No such file or directory {"type":2,"file":"/vagrant/vendor/gregwar/image/Gregwar/Image/Source/File.php","line":32,"level":28928} []
[2017-01-27 10:24:58] php.DEBUG: imagecreatefromjpeg(/vagrant/app/../web//vagrant/app/cache/dev/integrated/storage/file/06/9c/069c4da0c52b3cccff824f260920d482.jpg): failed to open stream: No such file or directory {"type":2,"file":"/vagrant/vendor/gregwar/image/Gregwar/Image/Adapter/GD.php","line":527,"level":28928} []

API
February 3, 2017, 10:32 AM

.Notificatie oplevering gestuurd naar Integrated Marijn (marijn@e-active.nl)

Assignee

Unassigned

Client

Integrated Marijn

Sprint

None

Fix versions

Configure