new Promise((resolve, reject) => {
var img = new Image();
img.onload = () => resolve(img);
img.onerror = reject;
img.src - '/upload/' + data['name'];
}).then(
naturalWidth => {
$('.tech').append("<img src='/upload/" + data['name'] + "' class='" + data['id'] + " toimg'><p class='psize'></p></div>");
$('.psize').append(naturalWidth);
},
error => {
//картинка не загрузилась
}
)