Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Opening File: Why is Pixel Width affected by Resolution?

Community Beginner ,
Nov 28, 2014 Nov 28, 2014

Simple code to open an EPS file and wanting to set its width to 500px. If I set the resolution to 72 it works fine. If I leave out the resolution line is ends up being about 7x as big (approx. 3500px). If I set the resolution to 300, the image is about 4x as big. In my mind resolution shouldn't affect the size of the image, because I'm working in absolute pixels and not inches. Any insight would be appreciated.

app.preferences.rulerUnits = Units.PIXELS

var fileRef = File(app.path+"/Presets/Scripts/BBY_FPO_Watermark.eps")

var epsOpts = new EPSOpenOptions();

epsOpts.antiAlias = true

epsOpts.constrainProportions=true

epsOpts.resolution=72   // if I omit this line or change this to a higher number the image gets much bigger than the 500px I specified below

epsOpts.width=500

app.open( fileRef, epsOpts )

TOPICS
Actions and scripting
362
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
Enthusiast ,
Nov 29, 2014 Nov 29, 2014
LATEST

Try setting 'epsOpts.width="500px", I think I hit some scenario where app.preferences.rulerUnits was not followed as default units (to be fair, it's rulers units). Also I guess it could be that EPS has coordinates in inches/mm (=static) and so the two are alternative ways of defining rendering accuracy with .resolution having higher priority.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines