- if ((int) (0.5 + (sp->from.w * 1000 / sp->from.h)) !=
- (int) (0.5 + (sp->to.w * 1000 / sp->to.h)))
- {
- fprintf (stderr, "%s: botched aspect: %f x %f vs %f x %f: %s\n",
- progname, sp->from.w, sp->from.h, sp->to.w, sp->to.h,
- sp->img->title);
- abort();
- }
+ {
+ int r1 = 0.5 + (sp->from.w * 1000 / sp->from.h);
+ int r2 = 0.5 + (sp->to.w * 1000 / sp->to.h);
+ if (r1 < r2-1 || r1 > r2+1)
+ {
+ fprintf (stderr,
+ "%s: botched aspect: %f x %f (%d) vs %f x %f (%d): %s\n",
+ progname,
+ sp->from.w, sp->from.h, r1,
+ sp->to.w, sp->to.h, r2,
+ (sp->img->title ? sp->img->title : "[null]"));
+ abort();
+ }
+ }