Skip to content

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

Closed
@WhittenMike807

Description

@WhittenMike807

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);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions