Warning: session_start(): open(/var/lib/php/sessions/sess_sd8biu2u9nudg6vts9ql43okep, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51
Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
srecord noeq PadImageToAspectRatio(BufferedImage img, Ratio ratio, Color color) > Meta {
BufferedImage out;
BufferedImage get() {
int w = img.getWidth(), h = img.getHeight();
double actualRatio = doubleRatio(w, h);
double targetRatio = this.ratio!;
int w2 = w, h2 = h;
if (targetRatio > actualRatio) // target ratio is wider
w2 = iround(h2*targetRatio);
else
h2 = iround(w2/targetRatio);
if (scaffolding()) printVars(+w, +h, +w2, +h2, +actualRatio, +targetRatio, ratio := this.ratio);
if (w == w2 && h == h2) ret img;
out = newImage(w2, h2, color);
drawImageOnImage(img, out, (w2-w)/2, (h2-h)/2);
ret out;
}
}