gavinbunney / Toucan

Fabulous Image Processing in Swift
MIT License
2.44k stars 224 forks source link

Resizing image doubles the scale of the original image #61

Closed lmsmartins closed 6 years ago

lmsmartins commented 7 years ago

The initial image scale is 1, but when resizing the image using Toucan, the image scale is changed to 2, so when I convert the image to Data and send it to server, the image size is double than the size I used to resize the image.

// Image scale was 1
let resizedImage = Toucan.Resize.resizeImage(image, size: CGSize(width: 500, height: 500))
// Image scale becomes 2
// Convert image to Data
let imageData = UIImageJPEGRepresentation(resizedImage, 0.8)!
// Send to server via HTTP

Is it possible for Toucan to maintain the original image scale?

Snitram

gavinbunney commented 6 years ago

This should be fixed by: https://github.com/gavinbunney/Toucan/pull/49