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

Odd behavior when using the iPhone camera, images are being saved black. #1591

Open
WhittenMike807 opened this issue Mar 21, 2024 · 1 comment

Comments

@WhittenMike807
Copy link

Magick.NET version

Magick.NET-Q16-AnyCPU 13.6.0

Environment (Operating system, version and so on)

Azure Function

Description

Having a odd behavior when trying to covert a jpeg image that's being upload by using the iOS/iPhone camera. If I use any other image, like from the desktop or from the iOS photo album, it works fine, just comes back as black image very time I use the image taken from the camera directly.

Steps to Reproduce

        Stream memStream = new MemoryStream();
        await file.CopyToAsync(memStream);
        memStream.Seek(0, SeekOrigin.Begin);


        MagickImage img = new MagickImage(memStream);
        img.AutoLevel();
        
        img.Format = MagickFormat.Jpeg;
        img.ColorType = ColorType.TrueColor;
        img.ColorSpace = ColorSpace.YCbCr;
        img.Resize(300, 0);
        img.SetCompression(CompressionMethod.JPEG);

        Console.Write(img.TotalColors.ToString());

        //img.TransformColorSpace(ColorProfile.USWebCoatedSWOP, ColorProfile.SRGB);
        //img.ColorAlpha(MagickColors.White);


        //img.Normalize();
        //img.AutoGamma();


        await img.WriteAsync(memStream);
        memStream.Seek(0, SeekOrigin.Begin);

        await blobClient.UploadAsync(memStream);
@dlemstra
Copy link
Owner

Are you going to buy me an iPhone that I can use to reproduce this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants