mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-23 14:42:29 +01:00
Optimized some of the previous changes related to order of evaluation.
This commit is contained in:
@@ -614,6 +614,8 @@ image2StandardPseudoColor(RContext *ctx, RImage *image)
|
||||
err = (short*)malloc(3*(image->width+2)*sizeof(short));
|
||||
nerr = (short*)malloc(3*(image->width+2)*sizeof(short));
|
||||
if (!err || !nerr) {
|
||||
if (err)
|
||||
free(err);
|
||||
if (nerr)
|
||||
free(nerr);
|
||||
RErrorCode = RERR_NOMEMORY;
|
||||
@@ -626,7 +628,6 @@ image2StandardPseudoColor(RContext *ctx, RImage *image)
|
||||
err[x++] = ptr[x1++];
|
||||
}
|
||||
err[x] = err[x+1] = err[x+2] = 0;
|
||||
x += 3;
|
||||
/* convert and dither the image to XImage */
|
||||
for (y=0, ofs=0; y<image->height; y++) {
|
||||
if (y<image->height-1) {
|
||||
|
||||
@@ -185,9 +185,9 @@ RLoadJPEG(RContext *context, char *file_name, int index)
|
||||
jpeg_read_scanlines(&cinfo, buffer,(JDIMENSION) 1);
|
||||
bptr = buffer[0];
|
||||
for (i=0; i<cinfo.image_width; i++) {
|
||||
*ptr = *(ptr+1) = *(ptr+2) = *bptr;
|
||||
bptr++;
|
||||
ptr += 3;
|
||||
*ptr++ = *bptr;
|
||||
*ptr++ = *bptr;
|
||||
*ptr++ = *bptr++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user