Skip to content

SKBitmap.ByteCount should support images >2GB #2244

Open
@ziriax

Description

@ziriax

The following code is problematic for large images, it throwns an overflow exception

 /// <summary>Returns the byte size of the pixels, based on the <see cref="P:SkiaSharp.SKBitmap.Height" /> and <see cref="P:SkiaSharp.SKBitmap.RowBytes" />.</summary>
    /// <value>The byte size of the pixels.</value>
    /// <remarks>Note: this truncates the result to 32-bits.</remarks>
    public int ByteCount => (int) SkiaApi.sk_bitmap_get_byte_count(this.Handle);

I suggest to convert this to a long or ulong?

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/SkiaSharpIssues that relate to the C# binding of SkiaSharp.type/bug

    Type

    No type

    Projects

    Status

    New

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions