Join GitHub today
process a crop as a resize when possible #201
Currently dokuwiki will generate two cached images when both width & height for an image in the wiki, a 'crop' then a 'resize'. When the aspect ratio of the crop matches the aspect ratio of the source image, it is effectively the equivalent of a resize.
This patches adds a check in the crop function to see if the final image dimensions would match those of a resize and if so, calls resize immediately rather than after the crop, resulting in one cached image.
e.g. source image.jpg 2574px x 1926px