merge conflict

master
Pierre Joye 2021-09-10 04:57:22 +07:00
commit 02f5a7ae05
6 changed files with 28 additions and 15 deletions

View File

@ -64,15 +64,15 @@ CI means whether we have an automatic CI for this platform. If someone has CI fo
| Platform | Support | CI |
| ------------- | ------------- |----|
| Linux x64 | 🗸 | 🗸 |
| Linux x86 | 🗸 | 🗸 |
| Linux ARM64 | 🗸 | 🗸 |
| Windows x86 | 🗸 | 🗸 |
| Windows x64 | 🗸 | 🗸 |
| Windows arm64 | 🗸 | x |
| MacOS x64 | 🗸 | 🗸 |
| MacOS M1 | 🗸 | x |
| S390 | 🗸 | x |
| Linux x64 | ✓ | ✓ |
| Linux x86 | ✓ | ✓ |
| Linux ARM64 | ✓ | ✓ |
| Windows x86 | ✓ | ✓ |
| Windows x64 | ✓ | ✓ |
| Windows arm64 | ✓ | x |
| MacOS x64 | ✓ | ✓ |
| MacOS M1 | ✓ | x |
| S390 | ✓ | x |
It is also known to work on almost all variations of *BSD, Solaris, etc. We don't have CI nor environment to test them. However many progamming languages binding do test libgd on these platforms.

View File

@ -21,7 +21,7 @@ main (int argc, char **argv)
fprintf (stderr,
"Usage: gd2topng filename.gd2 filename.png [srcx srcy width height]\n");
fprintf (stderr,
"If the coordinates are absent,t he entire image is converted.\n");
"If the coordinates are absent, the entire image is converted.\n");
exit (1);
}
if (argc == 7) {

View File

@ -30,6 +30,7 @@
#include <stdlib.h>
#include "gd.h"
#include "gdhelpers.h"
#include "gd_errors.h"
#include "bmp.h"
static int compress_row(unsigned char *uncompressed_row, int length);
@ -266,7 +267,11 @@ static int _gdImageBmpCtx(gdImagePtr im, gdIOCtxPtr out, int compression)
bitmap_size += compressed_size;
gdPutBuf(uncompressed_row, compressed_size, out);
if (gdPutBuf(uncompressed_row, compressed_size, out) != compressed_size){
gd_error("gd-bmp write error\n");
error = 1;
break;
}
gdPutC(BMP_RLE_COMMAND, out);
gdPutC(BMP_RLE_ENDOFLINE, out);
bitmap_size += 2;
@ -325,7 +330,10 @@ static int _gdImageBmpCtx(gdImagePtr im, gdIOCtxPtr out, int compression)
if (buffer_size == 0) {
break;
}
gdPutBuf(copy_buffer , buffer_size, out_original);
if (gdPutBuf(copy_buffer , buffer_size, out_original) != buffer_size) {
gd_error("gd-bmp write error\n");
error = 1;
}
}
gdFree(copy_buffer);
@ -335,7 +343,7 @@ static int _gdImageBmpCtx(gdImagePtr im, gdIOCtxPtr out, int compression)
out_original = NULL;
}
ret = 0;
ret = error;
cleanup:
if (tmpfile_for_compression) {
#ifdef _WIN32

View File

@ -227,8 +227,13 @@ static int _gdImageWebpCtx (gdImagePtr im, gdIOCtx * outfile, int quality)
ret = 1;
goto freeargb;
}
gdPutBuf(out, out_size, outfile);
int res = gdPutBuf(out, out_size, outfile);
free(out);
if (res != out_size) {
gd_error("gd-webp write error\n");
ret = 1;
}
freeargb:
gdFree(argb);

View File

@ -35,7 +35,7 @@ int main()
im = gdImageCreateTrueColor(10, 10);
fp = gdTestTempFp();
gdTestAssert(fp!=NULL);
gdTestAssert(fp != NULL);
if (!fp) {
exit(2);
}

0
tmp/preamble.txt Normal file
View File