Jump to content

Recommended Posts

Posted (edited)

Is it possible to find the dimensions of an eps file? I was able to get the dimensions if I converted the file to a bitmap, but when I try to run it using an eps file GDIplus just return a -1/-1 for the height /width of the file (same for svg files).  Was really hoping to find a solution using eps files, instead of converting them all to pngs to get the dimensions.

Was using the example provided by AutoBert here: 

 

*Just realized I posted this in the wrong forum too... (moved... Jos)

Edited by Jos
Posted

Well i dont know much about this encapsulated files, but they say it can have a preview bitmap, and this is what i assume you want the dimensions of.

I have a possible solution, but it depends on your skill, so the idea i had is that you could read the byte where the dimensions info is on.

You basically get to identical eps files, and change the image size in one of them, then compare the two, if there's not much messing around with encryption or something, hopefully only a couple bytes will change, you then have to know what you're looking at, maybe convert the hex to decimal and see how it compares to the dimensions..

It's a mess tbh, i did a similar thing when i wanted to remove images from mp3's, after that i know exactly where the image would start and what bytes represented the end of the bmp's.

  Reveal hidden contents

IUIAutomation - Topic with framework and examples

Au3Record.exe

Posted

What exactly you want to get ?

Width height depth/colors ?

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted

https://en.wikipedia.org/wiki/Encapsulated_PostScript

https://www.adobe.com/content/dam/acom/en/devnet/actionscript/articles/5001.DSC_Spec.pdf
https://www-cdf.fnal.gov/offline/PostScript/5002.PDF

Read:
Guidelines for Creating EPS Files
Required DSC Header Comments

You can also read this:
https://www.loc.gov/preservation/digital/formats/fdd/fdd000246.shtml

You must focus on:

  Quote
  • '%%BoundingBox: llx lly urx ury'
    The four arguments of the bounding box comment correspond to the lower-left (llx, lly) and upper-right (urx, ury) corners of the bounding box.
Expand  

 

As far, as I remember EPS i just plain text document.
So you should read them and parse to find/get '%%BoundingBox: llx lly urx ury', and recalcutate this coordinates.

mLipok

 

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...