PHOTOSHOP - how can I get the file size of a document?

  • 1
  • Question
  • Updated 3 years ago
  • (Edited)
Hi,
I have a problem, hope for solution.
I know how to open document (image file).
I didn't understood how can I get physical size of the document, I mean how the image file that I opened weight?
Thanks.
Photo of D F

D F

  • 4 Posts
  • 0 Reply Likes

Posted 3 years ago

  • 1
Photo of D F

D F

  • 4 Posts
  • 0 Reply Likes
As additional info to my question:
I talk about open image file weight size through the javascript:

....
var opener = new ActionDescriptor();
opener.putPath(charIDToTypeID("null"), file);
executeAction(charIDToTypeID("Opn "), opener, DialogModes.NO);

// Select the opened document
var document = app.activeDocument;

size of file?
......
Photo of Chris Cox

Chris Cox

  • 20280 Posts
  • 823 Reply Likes
Digital documents don't have a physical weight.

What exactly are you trying to measure/determine about your documents?
Photo of D F

D F

  • 4 Posts
  • 0 Reply Likes
In my office, the task was to take image file and than perform optimization size of it.
I wrote script based on tinyPNG algorithm. All run through Photoshop. I needed to give in report information on file size before and after optimization process.
Everything done by javascript and process now is almost fully automatic.

Actually I solved this issue.
Photo of Chris Cox

Chris Cox

  • 20280 Posts
  • 823 Reply Likes
OK, so you are looking for file size. You could have done that in Save For Web.

Without choosing a file format and options for saving, Photoshop cannot know the final file size (because that depends on the format, options chosen, as well as the image data and how well it compresses). But in Save For Web you choose the formats and options, and can see the resulting file size, or choose to optimize for a given file size limit.