https://bugzilla.wikimedia.org/show_bug.cgi?id=25990
--- Comment #7 from Tim Starling <[email protected]> 2011-03-21 23:42:16 UTC --- (In reply to comment #6) > I've changed to im_shrink in r84471. The problem however is that due to > rounding, the results may be inaccurate, i.e. images of 179px wide instead of > 180px. The result is then that the browser upsizes the image again. There's 53 bits of precision in a floating-point number, you should be able to manipulate these tiny integers without rounding errors. /* Prepare output. Note: we round the output width down! */ ... out->Xsize = in->Xsize / xshrink; out->Ysize = in->Ysize / yshrink; typedef struct im__IMAGE { ... int Xsize; int Ysize; If you offset the destination sizes by 0.5px, then the output size should always be accurate. You need to add sharpening. I discussed sharpening on bug 23258. Note that sharpening is only necessary for images which are resized by significant factor, see $wgSharpenReductionThreshold. For small images that are resized to a size that is only slightly smaller, you should use a VIPS function that has interpolation. For PagedTiffHandler, we could get away with ignoring this case, but if we use VIPS to scale all images, then we have to think about every possible case. -- Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug. You are on the CC list for the bug. _______________________________________________ Wikibugs-l mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/wikibugs-l
