mirror of
https://github.com/lovell/sharp.git
synced 2026-02-16 03:16:16 +01:00
Simplify StaySequential operation (#4074)
This commit is contained in:
committed by
GitHub
parent
36e60bf040
commit
aa8bc19362
@@ -1081,11 +1081,10 @@ namespace sharp {
|
||||
/*
|
||||
Ensure decoding remains sequential.
|
||||
*/
|
||||
VImage StaySequential(VImage image, VipsAccess access, bool condition) {
|
||||
static const char* meta = "sharp-copy-memory";
|
||||
if (access == VIPS_ACCESS_SEQUENTIAL && condition && image.get_typeof(meta) != G_TYPE_INT) {
|
||||
image = image.copy_memory();
|
||||
image.set(meta, 1);
|
||||
VImage StaySequential(VImage image, bool condition) {
|
||||
if (vips_image_is_sequential(image.get_image()) && condition) {
|
||||
image = image.copy_memory().copy();
|
||||
image.remove(VIPS_META_SEQUENTIAL);
|
||||
}
|
||||
return image;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user