xperseguers / t3ext-extractor

TYPO3 Extension extractor
https://extensions.typo3.org/extension/extractor
GNU General Public License v2.0
15 stars 24 forks source link

Data too long for column 'color_space' at row 1 #22

Closed jrenggli closed 4 years ago

jrenggli commented 4 years ago

Sometimes I experience a DriverException with the following message

Data too long for column 'color_space' at row 1

In my case this exception has been caused by color_space being set to "Uncalibrated" by ExifToolService. This value is both too long and not defined in the items list for color_space.

According to https://github.com/TYPO3/TYPO3.CMS/blob/master/typo3/sysext/filemetadata/ext_tables.sql the field `color_space supports up to 4 characters.

CREATE TABLE sys_file_metadata (
  ...
  # RGB,sRGB,YUV, ...
  color_space varchar(4) DEFAULT '',
       ...
);

And according to the TCA configuration of EXT:filemetadata (https://github.com/TYPO3/TYPO3.CMS/blob/master/typo3/sysext/filemetadata/Configuration/TCA/Overrides/sys_file_metadata.php) the following values are valid

  • RGB
  • sRGB
  • CMYK
  • CMY
  • YUV
  • grey
  • indx
jrenggli commented 4 years ago

When having a look at TYPO3 instances in production I see several values that are not "valid". e.g.

I don't know where these values come from. Maybe it's from an updated version of exiftool command. Currently I'm using version 10.10 and 10.40

IMHO Utility/ColorSpace should only pass "valid" strings. I don't know if we could map values to "valid" ones. As last resort I suggest to return an empty string.

@xperseguers: What do you think? If you agree I could try to create a PR adjusting Utility/ColorSpace.

xperseguers commented 4 years ago

yes please do so.

xperseguers commented 4 years ago

looks ok, can you please create the PR?

xperseguers commented 4 years ago

ok, PR was not linked to that ticket but is merged. Thanks.