* src/images/mk_blue_marble.py: Provide fallback if jpegtrans does not work/exist.

svn: r6311
This commit is contained in:
Martin Hawlisch 2006-04-11 17:04:42 +00:00
parent 250f60b4f7
commit a53704e879
2 changed files with 7 additions and 2 deletions

View File

@ -1,6 +1,6 @@
2006-04-11 Martin Hawlisch <Martin.Hawlisch@gmx.de>
* src/images/mk_blue_marble.py: Properly exit on error to let `make`
stop in that case.
stop in that case; Provide fallback if jpegtrans does not work/exist.
2006-04-10 Martin Hawlisch <Martin.Hawlisch@gmx.de>
* src/DataViews/_MapView.py: Reworked to display multiple smaller

View File

@ -29,7 +29,12 @@ def process_file( imagefile, image_width, image_height, map_x, map_y, map_width,
(tile_size,tile_size,x*tile_size,y*tile_size,outfile,imagefile)
print cmd
if os.system( cmd):
sys.exit("ERROR, image crop using jpegtran (part of libjpeg-progs) failed.")
print("WARNING: lossless crop using jpegtran (part of libjpeg-progs) failed. Trying lossy fallback")
cmd = "convert %s -crop %dx%d+%d+%d %s" %\
(imagefile,tile_size,tile_size,x*tile_size,y*tile_size,outfile)
print cmd
if os.system( cmd):
sys.exit("ERROR, image crop using jpegtran (part of libjpeg-progs) and imagemagick failed.")
else:
print "tile %s already exists" % outfile
tile_width = map_width/(image_width/tile_size)