Bug #91967

Properties width and height are not extracted to meta data for PDF files

Added by Helmut Hummel about 1 month ago. Updated about 1 month ago.

Status:
Resolved
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2020-08-10
Due date:
% Done:

100%

TYPO3 Version:
9
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

TYPO3 can be configured that pdf files are "image files", so that a thumbnail is generated for them
using imagemagick. But during meta data extraction width and height of pdf files are not extracted
because the mime type of pdf files is not image/* but the indexer checks for this type.

Instead the isImage method on the file should be used to trigger extraction of width and height.
imagemagick can do this with the identify command.

While the exact pixel values do not matter much for a PDF, the ratio of width and height (langscape or protrait or even square) can be very useful to "know".


Related issues

Related to TYPO3 Core - Bug #92287: After upgrading to ver. 9.5.21 uploading of pdf files causes an exception Resolved 2020-09-11

Associated revisions

Revision 4bf6ac54 (diff)
Added by Helmut Hummel about 1 month ago

[BUGFIX] Extract width and height meta data for all image files

Instead of looking at the mime type of the file, the configured
image file extensions is checked to decide whether to extract
width and height for sys_file_metadata.

This allows pdf files to have their width and height to be extracted.

While the exact pixel values do not matter much for a PDF,
the ratio of width and height (landscape or portrait or even square)
can be very useful to "know".

Releases: master, 10.4, 9.5
Resolves: #91967
Change-Id: I354be4f07edf6e4c3b59748ccb87b67dd66caa8e
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/65277
Tested-by: TYPO3com <>
Tested-by: Tim Schreiner <>
Tested-by: Markus Klein <>
Tested-by: Georg Ringer <>
Reviewed-by: Simon Praetorius <>
Reviewed-by: Tim Schreiner <>
Reviewed-by: Markus Klein <>
Reviewed-by: Georg Ringer <>

Revision 44ad9489 (diff)
Added by Helmut Hummel about 1 month ago

[BUGFIX] Extract width and height meta data for all image files

Instead of looking at the mime type of the file, the configured
image file extensions is checked to decide whether to extract
width and height for sys_file_metadata.

This allows pdf files to have their width and height to be extracted.

While the exact pixel values do not matter much for a PDF,
the ratio of width and height (landscape or portrait or even square)
can be very useful to "know".

Releases: master, 10.4, 9.5
Resolves: #91967
Change-Id: I354be4f07edf6e4c3b59748ccb87b67dd66caa8e
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/65296
Tested-by: TYPO3com <>
Tested-by: Helmut Hummel <>
Reviewed-by: Helmut Hummel <>

Revision 1dc0cba4 (diff)
Added by Helmut Hummel about 1 month ago

[BUGFIX] Extract width and height meta data for all image files

Instead of looking at the mime type of the file, the configured
image file extensions is checked to decide whether to extract
width and height for sys_file_metadata.

This allows pdf files to have their width and height to be extracted.

While the exact pixel values do not matter much for a PDF,
the ratio of width and height (landscape or portrait or even square)
can be very useful to "know".

Releases: master, 10.4, 9.5
Resolves: #91967
Change-Id: I354be4f07edf6e4c3b59748ccb87b67dd66caa8e
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/65323
Tested-by: Helmut Hummel <>
Tested-by: TYPO3com <>
Reviewed-by: Helmut Hummel <>

Revision 1451e560 (diff)
Added by Benni Mack 6 days ago

[BUGFIX] Deliver detected file type for IM identify

Although not used in TYPO3 Core directly, the identify
command by ImageMagick now delivers the file extension
from IM plus the file type identified by IM as well.

This saves some regexp magic, and a foreach() loop,
as the "-format" output delivers proper IM results.

While previously this change was only targeted
for master, it is now backported to 9.5 because
otherwise https://review.typo3.org/65277 causes
a regression when indexing PDF files.

Related: #91967
Resolves: #92287
Resolves: #23348
Releases: 9.5
Change-Id: Ia380ee34dbbef7f9f763ecc088ee0c9b83167ce6
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/65711
Tested-by: Sybille Peters <>
Tested-by: Daniel Sattler <>
Tested-by: Georg Ringer <>
Tested-by: Helmut Hummel <>
Tested-by: TYPO3com <>
Reviewed-by: Georg Ringer <>
Reviewed-by: Benni Mack <>

History

#1 Updated by Gerrit Code Review about 1 month ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/65277

#2 Updated by Gerrit Code Review about 1 month ago

Patch set 1 for branch 10.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/65296

#3 Updated by Helmut Hummel about 1 month ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

#4 Updated by Gerrit Code Review about 1 month ago

  • Status changed from Resolved to Under Review

Patch set 1 for branch 9.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/65323

#5 Updated by Helmut Hummel about 1 month ago

  • Status changed from Under Review to Resolved

#6 Updated by Georg Ringer 11 days ago

  • Related to Bug #92287: After upgrading to ver. 9.5.21 uploading of pdf files causes an exception added

Also available in: Atom PDF