From a519851903cdced7e1f18496263afef55313a014 Mon Sep 17 00:00:00 2001 From: Alexander Date: Sun, 6 Aug 2017 20:08:07 +0300 Subject: [PATCH] ImagingNew2 is always Dirty --- libImaging/Convert.c | 10 +++++----- libImaging/Copy.c | 2 +- libImaging/Imaging.h | 2 +- libImaging/Storage.c | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/libImaging/Convert.c b/libImaging/Convert.c index 0ec5ef864..f4253bda4 100644 --- a/libImaging/Convert.c +++ b/libImaging/Convert.c @@ -1035,7 +1035,7 @@ frompalette(Imaging imOut, Imaging imIn, const char *mode) else return (Imaging) ImagingError_ValueError("conversion not supported"); - imOut = ImagingNew2(mode, imOut, imIn); + imOut = ImagingNew2Dirty(mode, imOut, imIn); if (!imOut) return NULL; @@ -1073,7 +1073,7 @@ topalette(Imaging imOut, Imaging imIn, ImagingPalette inpalette, int dither) if (!palette) return (Imaging) ImagingError_ValueError("no palette"); - imOut = ImagingNew2("P", imOut, imIn); + imOut = ImagingNew2Dirty("P", imOut, imIn); if (!imOut) { if (palette != inpalette) ImagingPaletteDelete(palette); @@ -1211,7 +1211,7 @@ tobilevel(Imaging imOut, Imaging imIn, int dither) if (strcmp(imIn->mode, "L") != 0 && strcmp(imIn->mode, "RGB") != 0) return (Imaging) ImagingError_ValueError("conversion not supported"); - imOut = ImagingNew2("1", imOut, imIn); + imOut = ImagingNew2Dirty("1", imOut, imIn); if (!imOut) return NULL; @@ -1344,7 +1344,7 @@ convert(Imaging imOut, Imaging imIn, const char *mode, } #endif - imOut = ImagingNew2(mode, imOut, imIn); + imOut = ImagingNew2Dirty(mode, imOut, imIn); if (!imOut) return NULL; @@ -1407,7 +1407,7 @@ ImagingConvertTransparent(Imaging imIn, const char *mode, g = b = r; } - imOut = ImagingNew2(mode, imOut, imIn); + imOut = ImagingNew2Dirty(mode, imOut, imIn); if (!imOut){ return NULL; } diff --git a/libImaging/Copy.c b/libImaging/Copy.c index b5b0b0aea..992b8b505 100644 --- a/libImaging/Copy.c +++ b/libImaging/Copy.c @@ -28,7 +28,7 @@ _copy(Imaging imOut, Imaging imIn) if (!imIn) return (Imaging) ImagingError_ValueError(NULL); - imOut = ImagingNew2(imIn->mode, imOut, imIn); + imOut = ImagingNew2Dirty(imIn->mode, imOut, imIn); if (!imOut) return NULL; diff --git a/libImaging/Imaging.h b/libImaging/Imaging.h index cb16b440e..d46114133 100644 --- a/libImaging/Imaging.h +++ b/libImaging/Imaging.h @@ -160,7 +160,7 @@ extern int ImagingNewCount; extern Imaging ImagingNew(const char* mode, int xsize, int ysize); extern Imaging ImagingNewDirty(const char* mode, int xsize, int ysize); -extern Imaging ImagingNew2(const char* mode, Imaging imOut, Imaging imIn); +extern Imaging ImagingNew2Dirty(const char* mode, Imaging imOut, Imaging imIn); extern void ImagingDelete(Imaging im); extern Imaging ImagingNewBlock(const char* mode, int xsize, int ysize); diff --git a/libImaging/Storage.c b/libImaging/Storage.c index 6eb48d63c..615c5fa20 100644 --- a/libImaging/Storage.c +++ b/libImaging/Storage.c @@ -436,7 +436,7 @@ ImagingNewBlock(const char* mode, int xsize, int ysize) } Imaging -ImagingNew2(const char* mode, Imaging imOut, Imaging imIn) +ImagingNew2Dirty(const char* mode, Imaging imOut, Imaging imIn) { /* allocate or validate output image */ @@ -449,7 +449,7 @@ ImagingNew2(const char* mode, Imaging imOut, Imaging imIn) } } else { /* create new image */ - imOut = ImagingNew(mode, imIn->xsize, imIn->ysize); + imOut = ImagingNewDirty(mode, imIn->xsize, imIn->ysize); if (!imOut) return NULL; }