diff --git a/ChangeLog b/ChangeLog index 61a3cd7cf..62207ebd8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,6 @@ 2006-04-11 Martin Hawlisch * 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 * src/DataViews/_MapView.py: Reworked to display multiple smaller diff --git a/src/images/mk_blue_marble.py b/src/images/mk_blue_marble.py index f8c51bb1c..e93f24289 100644 --- a/src/images/mk_blue_marble.py +++ b/src/images/mk_blue_marble.py @@ -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)