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