You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Originally posted by antonfirsov December 17, 2024
Configuration.Default.MemoryAllocator=MemoryAllocator.Create(newMemoryAllocatorOptions(){AllocationLimitMegabytes=16});// Should throw InvalidMemoryOperationException when the total size of all frames// to allocate for this image would be over 16MB, even if the individual frame sizes are below 16MB.varimg=Image.Load("multiframe.gif");
Even though strictly speaking this would be a hack since the allocation limit is originally meant to be per-buffer, #2848 made me think this is something users want us to do. For built-in decoders, this is possible to implement by adding an internal validation method toMemoryAllocator; we can figure out later whether we want to make the feature available to external decoders.
The text was updated successfully, but these errors were encountered:
The problem with an extra property is that it adds complexity while I find it unlikely that users would want to configure the values separately; or do you see use cases where they would?
I thought all allocators must inherit MemoryAllocator
They all do. Note that the limit properties live in MemoryAllocatorOptions.
Discussed in #2849
Originally posted by antonfirsov December 17, 2024
Even though strictly speaking this would be a hack since the allocation limit is originally meant to be per-buffer, #2848 made me think this is something users want us to do. For built-in decoders, this is possible to implement by adding an internal validation method to
MemoryAllocator
; we can figure out later whether we want to make the feature available to external decoders.The text was updated successfully, but these errors were encountered: