all done!
a few more tests though
This commit is contained in:
parent
094470c9c1
commit
f0521d4b5d
@ -9,6 +9,8 @@
|
||||
- better python detection and build [Felix Bünemann]
|
||||
- max-alpha defaults to 65535 for RGB16/GREY16
|
||||
- added radsave_buffer [Henri Chain]
|
||||
- support tiff orientation tag
|
||||
- autorotate option for tiff load
|
||||
|
||||
18/5/16 started 8.3.2
|
||||
- more robust vips image reading
|
||||
|
8
TODO
8
TODO
@ -1,14 +1,8 @@
|
||||
- save a 16-bit image to tiff with jpg compression ... should it autoconvert?
|
||||
|
||||
- try
|
||||
|
||||
vips copy orientation-test.jpg x.tif
|
||||
vips copy x.tif x.jpg
|
||||
|
||||
orientation tag not preserved for tif->jpg
|
||||
|
||||
- add a set of tests for orientation
|
||||
|
||||
test autorotate flags on tiff and jpeg
|
||||
|
||||
see https://github.com/jcupitt/libvips/issues/243
|
||||
|
||||
|
@ -197,8 +197,8 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
*/
|
||||
#define DEBUG
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
|
@ -543,7 +543,7 @@ set_exif_orientation( ExifData *ed, VipsImage *im )
|
||||
/* We set the tag, even if it's been deleted, since it's a required
|
||||
* field.
|
||||
*/
|
||||
if( !vips_image_get_int( im, VIPS_META_ORIENTATION, &orientation ) )
|
||||
if( vips_image_get_int( im, VIPS_META_ORIENTATION, &orientation ) )
|
||||
orientation = 1;
|
||||
|
||||
VIPS_DEBUG_MSG( "set_exif_orientation: %d\n", orientation );
|
||||
|
@ -167,7 +167,7 @@ class TestForeign(unittest.TestCase):
|
||||
have_exif = False
|
||||
x = Vips.Image.new_from_file(self.jpeg_file)
|
||||
try:
|
||||
# our test image does have this field
|
||||
# our test image has this field
|
||||
y = x.get_value("exif-ifd0-Orientation")
|
||||
have_exif = True
|
||||
except:
|
||||
@ -177,11 +177,11 @@ class TestForeign(unittest.TestCase):
|
||||
# we need a copy of the image to set the new metadata on
|
||||
# otherwise we get caching problems
|
||||
x = x.copy()
|
||||
x.set_value("exif-ifd0-Orientation", "2")
|
||||
x.set_value("orientation", 2)
|
||||
x.write_to_file("test.jpg")
|
||||
x = Vips.Image.new_from_file("test.jpg")
|
||||
y = x.get_value("exif-ifd0-Orientation")
|
||||
self.assertEqual(y[0], "2")
|
||||
y = x.get_value("orientation")
|
||||
self.assertEqual(y, 2)
|
||||
|
||||
os.unlink("test.jpg")
|
||||
|
||||
@ -240,6 +240,18 @@ class TestForeign(unittest.TestCase):
|
||||
self.save_load_file("test-10.tif",
|
||||
"[tile,tile-width=256]", self.colour, 10)
|
||||
|
||||
# we need a copy of the image to set the new metadata on
|
||||
# otherwise we get caching problems
|
||||
x = Vips.Image.new_from_file(self.tiff_file)
|
||||
x = x.copy()
|
||||
x.set_value("orientation", 2)
|
||||
x.write_to_file("test.tif")
|
||||
x = Vips.Image.new_from_file("test.tif")
|
||||
y = x.get_value("orientation")
|
||||
self.assertEqual(y, 2)
|
||||
|
||||
os.unlink("test.tif")
|
||||
|
||||
def test_magickload(self):
|
||||
x = Vips.type_find("VipsForeign", "magickload")
|
||||
if not x.is_instantiatable():
|
||||
|
Loading…
Reference in New Issue
Block a user