File: test_image_info.py

package info (click to toggle)
gamera 1:3.4.2+git20160808.1725654-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 22,312 kB
  • ctags: 24,991
  • sloc: xml: 122,324; ansic: 52,869; cpp: 50,664; python: 35,034; makefile: 118; sh: 101
file content (16 lines) | stat: -rw-r--r-- 577 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
from gamera.core import *

from gamera.core import *
init_gamera()

def test_image_info():
   def _test_image_info(name, *args):
      for ext in ['png', 'tiff']:
         print "data/%s_generic.%s" % (name, ext)
         info = image_info("data/%s_generic.%s" % (name, ext))
         assert (info.depth, info.ncolors, info.ncols, info.nrows, info.x_resolution, info.y_resolution) == args

   # TODO: Add Grey16
   _test_image_info("OneBit", 1, 1, 70, 100, 0.0, 0.0)
   _test_image_info("RGB", 8, 3, 228, 130, 0.0, 0.0)
   _test_image_info("GreyScale", 8, 1, 97, 68, 0.0, 0.0)