Unverified Commit 1226028b authored by Vladimir Mandic's avatar Vladimir Mandic Committed by GitHub
Browse files

fix silly math error

parent 3c645915
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -485,7 +485,7 @@ class Script(scripts.Script):
        zs = process_axis(z_opt, z_values)
        zs = process_axis(z_opt, z_values)


        # this could be moved to common code, but unlikely to be ever triggered anywhere else
        # this could be moved to common code, but unlikely to be ever triggered anywhere else
        Image.MAX_IMAGE_PIXELS = opts.img_max_size_mp * 1.1 # allow 10% overhead for margins and legend
        Image.MAX_IMAGE_PIXELS = opts.img_max_size_mp * 1000000 * 1.1 # allow 10% overhead for margins and legend
        grid_mp = round(len(xs) * len(ys) * len(zs) * p.width * p.height / 1000000)
        grid_mp = round(len(xs) * len(ys) * len(zs) * p.width * p.height / 1000000)
        if grid_mp > opts.img_max_size_mp:
        if grid_mp > opts.img_max_size_mp:
            return Processed(p, [], p.seed, info=f'Error: Resulting grid would be too large ({grid_mp} MPixels) (max configured size is {opts.img_max_size_mp} MPixels)')
            return Processed(p, [], p.seed, info=f'Error: Resulting grid would be too large ({grid_mp} MPixels) (max configured size is {opts.img_max_size_mp} MPixels)')