6
$\begingroup$

Is there a way to find the ImageDimensions of an image file without Import'ing each one? The reason being that I have a directory with millions of JPEGs and it's really slow to Import each one separately.

$\endgroup$

1 Answer 1

9
$\begingroup$

The documentation says how to do this.

Import["image.jpg", "ImageSize"] // AbsoluteTiming

{0.052691, {2048, 1366}}

$\endgroup$
1
  • $\begingroup$ Nice, I totally missed that! $\endgroup$
    – M.R.
    Commented Jul 10, 2019 at 20:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.