File: test_save_image.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-- 534 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 *
init_gamera()

def test_save_image():
   def _test_save_image(name, storage = DENSE):
      for ext in ['png', 'tiff']:
         image = load_image("data/%s_generic.tiff" % name, storage)
         image.save_image("tmp/%s_test.%s" % (name, ext))
         image2 = load_image("tmp/%s_test.%s" % (name, ext))
         assert image._to_raw_string() == image2._to_raw_string()

   # TODO: Add Grey16
   for type in ["OneBit", "GreyScale", "RGB"]:
      _test_save_image(type)
   _test_save_image("OneBit", RLE)