How to retrieve width and height of JPG and PDFs?
How to retrieve width and height of JPG and PDFs?
Best answer by mac_sp
For the JPG, you can extract the width and height from the IFMERaster information:

Running your JPG features through a GeometryExtractor into Well Known Text will return a Polygon geometry type with the four corners of your image, as such:
POLYGON ((0 -960,0 0,528 0,528 -960,0 -960))
Your image width is simply the non-zero x coordinate and your height is the non-zero y coordinate.
For the PDF, you need to read rasterized pages in the reader parameters:

This will provide the Raster extents for each page (the 'pdf_page_number' attribute tracks the page number) and you can complete the above steps with the GeometryExtractor to derive the height and width.
EDIT: A CoordinateExtractor could be used to produce a similar result, simply depends on the user preference.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.
Login to the community
No account yet? Create an account
An FME Account is required to contribute
LoginEnter your E-mail address. We'll send you an e-mail with instructions to reset your password.


