apple code coding computer
TYPO3 Blog

Keeping Copyright Metadata in Images with TYPO3 

By default, TYPO3 tries to generate image files that are as small as it is possible with ImageMagick/GraphicsMagick. This means that it applies the predefined JPEG compression. But it also means that it strips almost all metadata from the files.

This makes a lot of sense if you think about the information modern cameras or mobile phones put into image metadata. Things like the camera type or the specific GPS coordinates where the image was shot are not only a waste of transfer size, they can also have privacy implications.

However, what you probably want to keep in the file is copyright information. If you purchase images from an image agency, they tend to set those to be able to control if the image is used properly. If you remove them, you could even breach the image licence you accepted when you bought them.

First of all, you need to find out which copyright information your image agency requires. In our example we need certain IPTC information.

Once you know what you want to keep, you simply modify the TYPO3 setting that takes care of metadata removal:


// Remove everything except for IPTC information (whitelist)
$GLOBALS['TYPO3_CONF_VARS']['GFX']['processor_stripColorProfileCommand'] = '+profile \'!iptc,*\'';

// Remove everything (TYPO3 default)
$GLOBALS['TYPO3_CONF_VARS']['GFX']['processor_stripColorProfileCommand'] = '+profile \'*\'';

A full documentation of the syntax can be found at the imagemagick documentation.