From c21f90c334a4d7a8f6764c749de0fdea6dc851f5 Mon Sep 17 00:00:00 2001 From: Guy Schalnat Date: Mon, 17 Jun 1996 16:24:45 -0500 Subject: [PATCH] Imported from libpng-0.89c.tar --- makefile | 2 +- makefile.aco | 1 + makefile.gcc => makefile.dj2 | 2 +- png.h | 28 +++++++++++++++------------- pngmem.c | 2 +- pngtest.png | Bin 8907 -> 8536 bytes pngtodo.txt | 2 -- pngwrite.c | 10 ---------- pngwutil.c | 23 ++++++++++++++++++----- 9 files changed, 37 insertions(+), 33 deletions(-) rename makefile.gcc => makefile.dj2 (96%) diff --git a/makefile b/makefile index b8a12b5d7..9d28c5641 100644 --- a/makefile +++ b/makefile @@ -13,7 +13,7 @@ RANLIB=echo prefix=/usr/local OBJS = png.o pngrcb.o pngrutil.o pngtrans.o pngwutil.o \ - pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o + pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \ pngwtran.o pngmem.o pngerror.o pngpread.o all: libpng.a pngtest diff --git a/makefile.aco b/makefile.aco index 2d8d408af..6ae1b8e4d 100644 --- a/makefile.aco +++ b/makefile.aco @@ -1,3 +1,4 @@ +# makefile for libpng on Acorn RISCOS # Project: libpng diff --git a/makefile.gcc b/makefile.dj2 similarity index 96% rename from makefile.gcc rename to makefile.dj2 index afc792371..495c0c600 100644 --- a/makefile.gcc +++ b/makefile.dj2 @@ -1,4 +1,4 @@ -# gcc/DOS makefile for libpng +# DJGPP (DOS gcc) makefile for libpng # Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc. # For conditions of distribution and use, see copyright notice in png.h diff --git a/png.h b/png.h index c17d7863f..53aea082c 100644 --- a/png.h +++ b/png.h @@ -5,15 +5,16 @@ May 25, 1996 Note: This is a beta version. It reads and writes valid files - on the platforms I have, but it has had limited portability - testing. Furthermore, you may have to modify the - includes below to get it to work on your system, and you - may have to supply the correct compiler flags in the makefile. - Read the readme.txt for more information, and how to contact - me if you have any problems, or if you want your compiler/ - platform to be supported in the next official libpng release. + on the platforms I have, and has had a wide testing program. + You may have to modify the includes below to get it to work on + your system, and you may have to supply the correct compiler + flags in the makefile, if you can't find a makefile suitable for + your operating system/compiler combination. Read the libpng.txt + for more information, and how to contact me if you have any + problems, or if you want your compiler/platform to be supported + in the next official libpng release. - See readme.txt for more information + See libpng.txt for more information Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc. Contributing Authors: @@ -33,17 +34,18 @@ and Group 42, Inc. disclaim all warranties, expressed or implied, including, without limitation, the warranties of merchantability and of fitness for any purpose. The Contributing Authors and Group 42, Inc. - assume no liability for damages, direct or consequential, which may - result from the use of the PNG Reference Library. + assume no liability for direct, indirect, incidental, special, exemplary, + or consequential damages, which may result from the use of the PNG + Reference Library, even if advised of the possibility of such damage. Permission is hereby granted to use, copy, modify, and distribute this source code, or portions hereof, for any purpose, without fee, subject to the following restrictions: 1. The origin of this source code must not be misrepresented. 2. Altered versions must be plainly marked as such and must not be - misrepresented as being the original source. + misrepresented as being the original source. 3. This Copyright notice may not be removed or altered from any source or - altered source distribution. + altered source distribution. The Contributing Authors and Group 42, Inc. specifically permit, without fee, and encourage the use of this source code as a component to @@ -763,7 +765,7 @@ extern void * png_realloc PNGARG((png_structp png_ptr, void * ptr, extern void png_free PNGARG((png_structp png_ptr, void * ptr)); /* allocate memory for an internal libpng struct */ -extern voidp png_create_struct PNGARG((uInt type)); +extern png_voidp png_create_struct PNGARG((uInt type)); /* free memory from internal libpng struct */ extern void png_destroy_struct PNGARG((voidp struct_ptr)); diff --git a/pngmem.c b/pngmem.c index d3fc99170..60645f0a9 100644 --- a/pngmem.c +++ b/pngmem.c @@ -221,7 +221,7 @@ png_create_struct(uInt type) if ((struct_ptr = (png_voidp)farmalloc(size)) != NULL) #else # if defined(_MSC_VER) && defined(MAXSEG_64K) - if ((struct_ptr = (png_voidp)halloc(size)) != NULL) + if ((struct_ptr = (png_voidp)halloc(size,1)) != NULL) # else if ((struct_ptr = (png_voidp)malloc(size)) != NULL) # endif diff --git a/pngtest.png b/pngtest.png index fc40f5ff8e0b67d2bba925df173e9ec295b9f36f..69383a6b6c519e6ff6a82d083753ec5288900da9 100644 GIT binary patch literal 8536 zcmV-eA*bGnP)K~#90?3z7nBT070f4n;buK_Pm zm34*Xtd&t28PXXiqcSPvW!j9B&4#m?l+9$PP!kv+0|TS%7?K$o7*GcbxPmiK4S0bn z;0*LLa6mg~>T9H#-5q<+@W%rhBGv5IuV1~7|NB?NuOXAlcYl~qI)LANdh+hXbm%*P zck@YC8ez2w0Q?T%bW$ywm}ZlqW3>yHB9sE0j;hWX;ls8b0F*{XzXABLu1`v1shq=z zEZ&|?V#sL)pxWPUI`mzWb$f48R;3P!qJTO?=9A-DXc9>kX9XkjU=l#omQ82?7<$9E zSL*>l^HCSGV}Akq^kL5@Rd+h6I)FE`Vb@<+&OYn9JMa8;<&SS>-J~izfZsko@pd*^ zuIqpK2Y~CvwAsKIAbR z+}NZC7seF$=Z_cNcD=zl!9_cAL)%TN^1?wBuGaO*7XZ_tUtXM!x-SL)Pl^%BufF(yw49Fo1w5@C&!Xj*iV-Q_%tl>N z$YMUJy1V}KizFVU%qPQ(eaI(STlP())xHLWtb?jF z%RBV3Tui%7Xf{ujyP{9&l#~z?_OR-$DmS~pVm4m%-(gaDj=V)xnN(%xoxR5r0*rk* zexlqyL=e^pyU@^N#XE};*wlgBcjuio1w-#ht>CR_;c?T0m`2;Nz&6`Hnf+P3fb zA?IyO>Ap*DLo-l?vvCCoBEr}^zWvab+{du85emGq_Y2duG#9J=&{-iS-2%M+upNY$ z?$_t+{mo!g$E}ruV{e;RkD$hr?yrEiaZ+4=pG|#4qUmu|U z0$DDmU7ZuO;H^aj>W~;#j#uBWp4j?}G49vO(3i9CX2M&HR-dwe?d@oenNm|DEEyj^Wh_Tg#0akj7NbrUhxb7!;>nVpRNayF{S zs$8vi2n9wgS$l&4MEWDdj1kJL59R0H@WWCrQ&yVPA_7U3I%JN0$*6MdLnNxQ+Juv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2ee&rByDfibE#Qz}T-oXT^SbPIDFkW0 zbQsJ)I2uPXWg#4nARIPvtSMHxcHN3!eV?!Xmk#y`B>hFok%5NE?Lx|L<1s;UNi z_O~G2$3s$t+g@M!;&&ds`u81@m7SGUbzYCo*@`5fB^sH1{{z3j`-k>v&YU^E&p!Ly z@Adfc>~qij;DHDJ$$a2%rr!2)hmx$(hLM74Gei;&Yi$K zv3t+lp1>y-ZR;Ufmf5|6qG(`870HoUwK0aKAo#(Z8uHjU;OkUmw_AYh3PPt8 z?kIlW8vj7=R2g|}jPuv$$2(r3mfRZ^wfZuHVjA2UD3GFo-^+KR$Zoe8L$nAq?3CzC ztsQ7?6>Pp&K{^(mhWC^q+IYsY=f9!>Ur~JT!Jy}0MmPpT=)p)wa^#evR%6E1?UWe& Z_6HdhTAl6V_{IPL002ovPDHLkV1jaS3t#{M diff --git a/pngtodo.txt b/pngtodo.txt index 3423f527e..8b8089b72 100644 --- a/pngtodo.txt +++ b/pngtodo.txt @@ -8,8 +8,6 @@ for 0.9 after 1.0 overlaying one image on top of another - make pull reader use push reader internally to reduce code, and - increase amount of image read in an error situation optional palette creation histogram creation text conversion between different code types diff --git a/pngwrite.c b/pngwrite.c index fd68e7a2a..338c369c3 100644 --- a/pngwrite.c +++ b/pngwrite.c @@ -409,16 +409,6 @@ png_write_row(png_structp png_ptr, png_bytep row) /* find a filter if necessary, filter the row and write it out */ png_write_find_filter(png_ptr, &(png_ptr->row_info)); - - /* trade current and prev rows so next filter references are correct */ - if (png_ptr->prev_row) - { - png_bytep tptr; - - tptr = png_ptr->prev_row; - png_ptr->prev_row = png_ptr->row_buf; - png_ptr->row_buf = tptr; - } } #if defined(PNG_WRITE_FLUSH_SUPPORTED) diff --git a/pngwutil.c b/pngwutil.c index 5ca26ef8a..c9821bc85 100644 --- a/pngwutil.c +++ b/pngwutil.c @@ -912,6 +912,7 @@ png_write_finish_row(png_structp png_ptr) /* next row */ png_ptr->row_number++; + /* see if we are done */ if (png_ptr->row_number < png_ptr->num_rows) return; @@ -947,13 +948,15 @@ png_write_finish_row(png_structp png_ptr) } /* reset the row above the image for the next pass */ - if (png_ptr->prev_row) - png_memset(png_ptr->prev_row, 0, (((png_uint_32)png_ptr->usr_channels * - (png_uint_32)png_ptr->usr_bit_depth * png_ptr->width + 7) >> 3) + 1); - - /* if we have more data to get, go get it */ if (png_ptr->pass < 7) + { + if (png_ptr->prev_row) + png_memset(png_ptr->prev_row, 0, + (((png_uint_32)png_ptr->usr_channels * + (png_uint_32)png_ptr->usr_bit_depth * + png_ptr->width + 7) >> 3) + 1); return; + } } /* if we get here, we've just written the last row, so we need @@ -1345,6 +1348,16 @@ png_write_filtered_row(png_structp png_ptr, png_bytep filtered_row) /* repeat until all data has been compressed */ } while (png_ptr->zstream->avail_in); + /* swap the current and previous rows */ + if (png_ptr->prev_row) + { + png_bytep tptr; + + tptr = png_ptr->prev_row; + png_ptr->prev_row = png_ptr->row_buf; + png_ptr->row_buf = tptr; + } + /* finish row - updates counters and flushes zlib if last row */ png_write_finish_row(png_ptr);