Author Topic: How to get the dpi of an image?  (Read 2057 times)

0 Members and 1 Guest are viewing this topic.

guohq

  • Newt
  • Posts: 84
How to get the dpi of an image?
« on: April 16, 2009, 11:08:59 AM »
I want to get the dpi of an image with lisp. How can I do?

Hedgehog

  • Guest
Re: How to get the dpi of an image?
« Reply #1 on: April 16, 2009, 11:41:11 AM »
I want to get the dpi of an image with lisp. How can I do?
Impossible without knowing what size the end product is to be printed at... it annoys me when files such as jpg's contain a value that pretends to be the dpi even though it has no physical reference size... it's dots per inch!

guohq

  • Newt
  • Posts: 84
Re: How to get the dpi of an image?
« Reply #2 on: April 16, 2009, 12:05:13 PM »
I can see the information of an image in property dialogue when I rigth click the image. So I think there is a way to get the dpi of the image use lisp perhaps.

VovKa

  • Water Moccasin
  • Posts: 1631
  • Ukraine
Re: How to get the dpi of an image?
« Reply #3 on: April 16, 2009, 12:51:21 PM »
Code: [Select]
(mapcar
     (function (lambda (r) (/ (CVUNIT 1 "INCH" "MM") r)))
     (reverse
       (cdr
(reverse
   (cdr
     (assoc 11
    (entget (cdr (assoc 340 (entget (car (entsel "\nSelect image: "))))))
     )
   )
)
       )
     )
   )

deegeecees

  • Guest
Re: How to get the dpi of an image?
« Reply #4 on: April 16, 2009, 01:12:12 PM »
Great stuff Vovka! Another piece of my personal puzzle is solved!

guohq

  • Newt
  • Posts: 84
Re: How to get the dpi of an image?
« Reply #5 on: April 16, 2009, 10:26:40 PM »
You are great!

 Thks a lot!

Hedgehog

  • Guest
Re: How to get the dpi of an image?
« Reply #6 on: April 20, 2009, 06:22:09 AM »
I can see the information of an image in property dialogue when I rigth click the image. So I think there is a way to get the dpi of the image use lisp perhaps.
So what are you going to use this information for?  :? ... as I said before, it's a useless non-figure... meaningless without a print size... the pixel count is far more useful & enables you to calc the correct dpi for the image you're printing.