You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 31, 2018. It is now read-only.
i'm trying to create a thumbnail of an image i uploaded to the server:
var w = img.width, h = img.height;
var neww = 75, newh = 75;
var wRatio = (neww / w);
var hRatio = (newh / h);
var cropw, croph;
var srcx = 0, srcy = 0;
if (w > h) {
cropw = Math.round(w * hRatio);
croph = newh;
srcx = Math.ceil( (w - h) / 2);
}
else if (w < h) {
croph = Math.round(h * wRatio);
cropw = neww;
srcy = Math.ceil( (h - w) / 2);
}
else {
cropw = neww;
croph = newh;
}
var target = gd.createTrueColor(neww, newh);
img.copyResampled(target, 0, 0, srcx, srcy, cropw, croph, img.width, img.height);
target.saveJpeg(dest, 90, function() {
// ...
});
the thumbnail isn't created but i don't know why and i don't get an error ... :(
The text was updated successfully, but these errors were encountered: