Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Image is upside down after webp compression #91

Closed
rishabh876 opened this issue Nov 21, 2023 · 2 comments · Fixed by #96
Closed

Image is upside down after webp compression #91

rishabh876 opened this issue Nov 21, 2023 · 2 comments · Fixed by #96
Labels
bug Something isn't working encoding WebP Encoding related

Comments

@rishabh876
Copy link

rishabh876 commented Nov 21, 2023

Following attached image from iPhone simulator is getting upside down after webp compression. I am using 0.14.2 version of SDWebImageWebPCoder.
Phone: iPhone 15
OS: 17.0

Code

func compressImageData(data: Data)-> Data? {
        let image = UIImage(data: data)
        let lossyWebpData = SDImageWebPCoder.shared.encodedData(with: image, format: .webP, options: [.encodeCompressionQuality: 0.8, .encodeMaxFileSize: 1024 * 1024])
        return lossyWebpData
    }

IMG_0006.HEIC.zip

@dreampiggy
Copy link
Contributor

Need more information to test. Seems the decoding part, not encoding part issue

@dreampiggy dreampiggy added bug Something isn't working encoding WebP Encoding related labels Feb 4, 2024
@dreampiggy
Copy link
Contributor

OK. Seems our webp coder does not handle the EXIF orientation for encoding

Only handle the EXIF orientation for decoding😂

截屏2024-02-04 17 51 41

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working encoding WebP Encoding related
Projects
None yet
2 participants