ImagingNew2 is always Dirty

This commit is contained in:
Alexander 2017-08-06 20:08:07 +03:00
parent eb4096ffd5
commit a519851903
4 changed files with 9 additions and 9 deletions

View File

@ -1035,7 +1035,7 @@ frompalette(Imaging imOut, Imaging imIn, const char *mode)
else else
return (Imaging) ImagingError_ValueError("conversion not supported"); return (Imaging) ImagingError_ValueError("conversion not supported");
imOut = ImagingNew2(mode, imOut, imIn); imOut = ImagingNew2Dirty(mode, imOut, imIn);
if (!imOut) if (!imOut)
return NULL; return NULL;
@ -1073,7 +1073,7 @@ topalette(Imaging imOut, Imaging imIn, ImagingPalette inpalette, int dither)
if (!palette) if (!palette)
return (Imaging) ImagingError_ValueError("no palette"); return (Imaging) ImagingError_ValueError("no palette");
imOut = ImagingNew2("P", imOut, imIn); imOut = ImagingNew2Dirty("P", imOut, imIn);
if (!imOut) { if (!imOut) {
if (palette != inpalette) if (palette != inpalette)
ImagingPaletteDelete(palette); ImagingPaletteDelete(palette);
@ -1211,7 +1211,7 @@ tobilevel(Imaging imOut, Imaging imIn, int dither)
if (strcmp(imIn->mode, "L") != 0 && strcmp(imIn->mode, "RGB") != 0) if (strcmp(imIn->mode, "L") != 0 && strcmp(imIn->mode, "RGB") != 0)
return (Imaging) ImagingError_ValueError("conversion not supported"); return (Imaging) ImagingError_ValueError("conversion not supported");
imOut = ImagingNew2("1", imOut, imIn); imOut = ImagingNew2Dirty("1", imOut, imIn);
if (!imOut) if (!imOut)
return NULL; return NULL;
@ -1344,7 +1344,7 @@ convert(Imaging imOut, Imaging imIn, const char *mode,
} }
#endif #endif
imOut = ImagingNew2(mode, imOut, imIn); imOut = ImagingNew2Dirty(mode, imOut, imIn);
if (!imOut) if (!imOut)
return NULL; return NULL;
@ -1407,7 +1407,7 @@ ImagingConvertTransparent(Imaging imIn, const char *mode,
g = b = r; g = b = r;
} }
imOut = ImagingNew2(mode, imOut, imIn); imOut = ImagingNew2Dirty(mode, imOut, imIn);
if (!imOut){ if (!imOut){
return NULL; return NULL;
} }

View File

@ -28,7 +28,7 @@ _copy(Imaging imOut, Imaging imIn)
if (!imIn) if (!imIn)
return (Imaging) ImagingError_ValueError(NULL); return (Imaging) ImagingError_ValueError(NULL);
imOut = ImagingNew2(imIn->mode, imOut, imIn); imOut = ImagingNew2Dirty(imIn->mode, imOut, imIn);
if (!imOut) if (!imOut)
return NULL; return NULL;

View File

@ -160,7 +160,7 @@ extern int ImagingNewCount;
extern Imaging ImagingNew(const char* mode, int xsize, int ysize); extern Imaging ImagingNew(const char* mode, int xsize, int ysize);
extern Imaging ImagingNewDirty(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 void ImagingDelete(Imaging im);
extern Imaging ImagingNewBlock(const char* mode, int xsize, int ysize); extern Imaging ImagingNewBlock(const char* mode, int xsize, int ysize);

View File

@ -436,7 +436,7 @@ ImagingNewBlock(const char* mode, int xsize, int ysize)
} }
Imaging Imaging
ImagingNew2(const char* mode, Imaging imOut, Imaging imIn) ImagingNew2Dirty(const char* mode, Imaging imOut, Imaging imIn)
{ {
/* allocate or validate output image */ /* allocate or validate output image */
@ -449,7 +449,7 @@ ImagingNew2(const char* mode, Imaging imOut, Imaging imIn)
} }
} else { } else {
/* create new image */ /* create new image */
imOut = ImagingNew(mode, imIn->xsize, imIn->ysize); imOut = ImagingNewDirty(mode, imIn->xsize, imIn->ysize);
if (!imOut) if (!imOut)
return NULL; return NULL;
} }