diff --git a/configure.ac b/configure.ac index c5bfe4276af..6f1ed6aa50e 100644 --- a/configure.ac +++ b/configure.ac @@ -1154,7 +1154,6 @@ AC_LANG_POP(C++) ## library is disabled. AC_SUBST([HDF5_HL]) AC_SUBST([HDF5_HL_TOOLS]) -AC_SUBST([HDF5_HL_GIF_TOOLS]) ## The high-level library and high-level tools are enabled unless the build mode ## is clean. @@ -1477,27 +1476,6 @@ AC_ARG_ENABLE([tools], AC_MSG_RESULT([$HDF5_TOOLS]) -## ---------------------------------------------------------------------- -## Check if they would like to disable building the high-level GIF -## tools (they have unfixed CVE issues) -## - -AC_MSG_CHECKING([if the high-level GIF tools are enabled]) -AC_ARG_ENABLE([hlgiftools], - [AS_HELP_STRING([--enable-hlgiftools], - [Enable the high-level GIF tools. NOTE: These have unfixed CVE issues! - [default=no] - ])], - [HDF5_HL_GIF_TOOLS=$enableval]) - -if test "X-$HDF5_TOOLS" = "X-yes" -a "X-$HDF5_HL" = "X-yes" -a "X-$HDF5_HL_GIF_TOOLS" = "X-yes"; then - AC_MSG_RESULT([yes]) -else - AC_MSG_RESULT([no]) - HDF5_HL_GIF_TOOLS="no" -fi - - ## ---------------------------------------------------------------------- ## Check if they would like to enable building doxygen files ## @@ -4411,7 +4389,6 @@ AM_CONDITIONAL([BUILD_HDF5_HL_CONDITIONAL], [test "X$HDF5_HL" = "Xyes"]) AM_CONDITIONAL([BUILD_TESTS_CONDITIONAL], [test "X$HDF5_TESTS" = "Xyes"]) AM_CONDITIONAL([BUILD_TESTS_PARALLEL_CONDITIONAL], [test -n "$TESTPARALLEL"]) AM_CONDITIONAL([BUILD_TOOLS_CONDITIONAL], [test "X$HDF5_TOOLS" = "Xyes"]) -AM_CONDITIONAL([BUILD_TOOLS_HL_GIF_CONDITIONAL], [test "X$HDF5_HL_GIF_TOOLS" = "Xyes"]) AM_CONDITIONAL([BUILD_DOXYGEN_CONDITIONAL], [test "X$HDF5_DOXYGEN" = "Xyes"]) ## ---------------------------------------------------------------------- @@ -4619,8 +4596,6 @@ AC_CONFIG_FILES([Makefile hl/test/Makefile hl/test/H5srcdir_str.h hl/tools/Makefile - hl/tools/gif2h5/Makefile - hl/tools/gif2h5/h52giftest.sh hl/tools/h5watch/Makefile hl/tools/h5watch/testh5watch.sh hl/examples/Makefile diff --git a/hl/tools/CMakeLists.txt b/hl/tools/CMakeLists.txt index a369d9efa18..cbff5a92157 100644 --- a/hl/tools/CMakeLists.txt +++ b/hl/tools/CMakeLists.txt @@ -1,12 +1,4 @@ cmake_minimum_required (VERSION 3.18) project (HDF5_HL_TOOLS C) -#----------------------------------------------------------------------------- -#-- Option to build the High level GIF Tools -#----------------------------------------------------------------------------- -option (HDF5_BUILD_HL_GIF_TOOLS "Build HDF5 HL GIF Tools" OFF) -if (HDF5_BUILD_HL_GIF_TOOLS) - add_subdirectory (gif2h5) -endif () - add_subdirectory (h5watch) diff --git a/hl/tools/Makefile.am b/hl/tools/Makefile.am index 9f93f676dce..620eb5dbfcc 100644 --- a/hl/tools/Makefile.am +++ b/hl/tools/Makefile.am @@ -18,13 +18,7 @@ include $(top_srcdir)/config/commence.am -if BUILD_TOOLS_HL_GIF_CONDITIONAL - TOOLS_GIF_DIR = gif2h5 -else - TOOLS_GIF_DIR = -endif - # All subdirectories -SUBDIRS=h5watch $(TOOLS_GIF_DIR) +SUBDIRS=h5watch include $(top_srcdir)/config/conclude.am diff --git a/hl/tools/gif2h5/CMakeLists.txt b/hl/tools/gif2h5/CMakeLists.txt deleted file mode 100644 index abef080910c..00000000000 --- a/hl/tools/gif2h5/CMakeLists.txt +++ /dev/null @@ -1,107 +0,0 @@ -cmake_minimum_required (VERSION 3.18) -project (HDF5_HL_TOOLS_GIF2H5 C) - -#----------------------------------------------------------------------------- -# Define Sources -#----------------------------------------------------------------------------- -set (GIF2H5_SOURCES - ${HDF5_HL_TOOLS_GIF2H5_SOURCE_DIR}/gif.h - ${HDF5_HL_TOOLS_GIF2H5_SOURCE_DIR}/decompress.c - ${HDF5_HL_TOOLS_GIF2H5_SOURCE_DIR}/gif2hdf.c - ${HDF5_HL_TOOLS_GIF2H5_SOURCE_DIR}/gif2mem.c - ${HDF5_HL_TOOLS_GIF2H5_SOURCE_DIR}/gifread.c - ${HDF5_HL_TOOLS_GIF2H5_SOURCE_DIR}/writehdf.c -) - -#-- Add gif2hdf5 program -add_executable (gif2h5 ${GIF2H5_SOURCES}) -target_compile_options(gif2h5 PRIVATE "${HDF5_CMAKE_C_FLAGS}") -target_include_directories (gif2h5 PRIVATE "${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") -if (HDF5_BUILD_STATIC_TOOLS) - TARGET_C_PROPERTIES (gif2h5 STATIC) - target_link_libraries (gif2h5 PRIVATE ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) -else () - TARGET_C_PROPERTIES (gif2h5 SHARED) - target_link_libraries (gif2h5 PRIVATE ${HDF5_HL_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} ${HDF5_TOOLS_LIBSH_TARGET}) -endif () -set_target_properties (gif2h5 PROPERTIES FOLDER tools/hl) -set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};gif2h5") -set (H5_DEP_EXECUTABLES - gif2h5 -) - -#----------------------------------------------------------------------------- -# Add Target to clang-format -#----------------------------------------------------------------------------- -if (HDF5_ENABLE_FORMATTERS) - clang_format (HDF5_HL_TOOLS_GIF2H5_FORMAT gif2h5) -endif () - -#-- Add h52gif program -set (hdf2gif_SOURCES - ${HDF5_HL_TOOLS_GIF2H5_SOURCE_DIR}/hdf2gif.c - ${HDF5_HL_TOOLS_GIF2H5_SOURCE_DIR}/hdfgifwr.c -) -add_executable (h52gif ${hdf2gif_SOURCES}) -target_compile_options(h52gif PRIVATE "${HDF5_CMAKE_C_FLAGS}") -target_include_directories (h52gif PRIVATE "${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") -if (HDF5_BUILD_STATIC_TOOLS) - TARGET_C_PROPERTIES (h52gif STATIC) - target_link_libraries (h52gif PRIVATE ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) -else () - TARGET_C_PROPERTIES (h52gif SHARED) - target_link_libraries (h52gif PRIVATE ${HDF5_HL_LIBSH_TARGET} PRIVATE ${HDF5_LIBSH_TARGET} ${HDF5_TOOLS_LIBSH_TARGET}) -endif () -set_target_properties (h52gif PROPERTIES FOLDER tools/hl) -set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h52gif") -set (H5_DEP_EXECUTABLES ${H5_DEP_EXECUTABLES} - h52gif -) - -#----------------------------------------------------------------------------- -# Add Target to clang-format -#----------------------------------------------------------------------------- -if (HDF5_ENABLE_FORMATTERS) - clang_format (HDF5_HL_TOOLS_H52GIF_FORMAT h52gif) -endif () - -if (BUILD_TESTING AND HDF5_TEST_SERIAL) - # -------------------------------------------------------------------- - # This executable can generate the actual test files - Currently not - # used in the CMake Build system as we rely on the test files that are - # shipped with HDF5 source archives - # -------------------------------------------------------------------- - if (HDF5_BUILD_GENERATORS AND BUILD_STATIC_LIBS) - add_executable (hl_h52gifgentest ${HDF5_HL_TOOLS_GIF2H5_SOURCE_DIR}/h52gifgentst.c) - target_include_directories (hl_h52gifgentest PRIVATE "${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") - TARGET_C_PROPERTIES (hl_h52gifgentest STATIC) - target_link_libraries (hl_h52gifgentest PRIVATE ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET}) - set_target_properties (hl_h52gifgentest PROPERTIES FOLDER generator/tools/hl) - - #----------------------------------------------------------------------------- - # Add Target to clang-format - #----------------------------------------------------------------------------- - if (HDF5_ENABLE_FORMATTERS) - clang_format (HDF5_HL_TOOLS_hl_h52gifgentest_FORMAT hl_h52gifgentest) - endif () - -# add_test (NAME hl_h52gifgentest COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $) - endif () - - if (HDF5_TEST_TOOLS) - include (CMakeTests.cmake) - endif () -endif () - -#----------------------------------------------------------------------------- -# Add file(s) to CMake Install -#----------------------------------------------------------------------------- -if (HDF5_EXPORTED_TARGETS) - install ( - TARGETS - ${H5_DEP_EXECUTABLES} - EXPORT - ${HDF5_EXPORTED_TARGETS} - RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT hltoolsapplications - ) -endif () diff --git a/hl/tools/gif2h5/CMakeTests.cmake b/hl/tools/gif2h5/CMakeTests.cmake deleted file mode 100644 index be431c1507b..00000000000 --- a/hl/tools/gif2h5/CMakeTests.cmake +++ /dev/null @@ -1,76 +0,0 @@ -# -# Copyright by The HDF Group. -# All rights reserved. -# -# This file is part of HDF5. The full HDF5 copyright notice, including -# terms governing use, modification, and redistribution, is contained in -# the COPYING file, which can be found at the root of the source code -# distribution tree, or in https://www.hdfgroup.org/licenses. -# If you do not have access to either file, you may request a copy from -# help@hdfgroup.org. -# - -############################################################################## -############################################################################## -### T E S T I N G ### -############################################################################## -############################################################################## - -# Make testfiles dir under build dir -file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") - -# -# copy test files from source to build dir -# -HDFTEST_COPY_FILE("${PROJECT_SOURCE_DIR}/testfiles/image1.gif" "${PROJECT_BINARY_DIR}/testfiles/image1.gif" "gif2h5_files") -HDFTEST_COPY_FILE("${PROJECT_SOURCE_DIR}/testfiles/h52giftst.h5" "${PROJECT_BINARY_DIR}/testfiles/h52giftst.h5" "gif2h5_files") -HDFTEST_COPY_FILE("${PROJECT_SOURCE_DIR}/testfiles/ex_image2.h5" "${PROJECT_BINARY_DIR}/testfiles/ex_image2.h5" "gif2h5_files") -add_custom_target(gif2h5_files ALL COMMENT "Copying files needed by gif2h5 tests" DEPENDS ${gif2h5_files_list}) - -# Remove any output file left over from previous test run -set (HL_TOOLS_CLEANFILES - image1.gif - image1.h5 - image.gif - image24.gif -) -add_test ( - NAME HL_TOOLS-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove ${HL_TOOLS_CLEANFILES} -) -set_tests_properties (HL_TOOLS-clear-objects PROPERTIES FIXTURES_SETUP clear_tools_hl) -add_test ( - NAME HL_TOOLS-clean-objects - COMMAND ${CMAKE_COMMAND} - -E remove ${HL_TOOLS_CLEANFILES} -) -set_tests_properties (HL_TOOLS-clean-objects PROPERTIES FIXTURES_CLEANUP clear_tools_hl) - -add_test (NAME HL_TOOLS_gif2h5 COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $ testfiles/image1.gif image1.h5) -set_tests_properties (HL_TOOLS_gif2h5 PROPERTIES - FIXTURES_REQUIRED clear_tools_hl -) - -add_test (NAME HL_TOOLS_h52gif COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $ testfiles/h52giftst.h5 image1.gif -i image) -set_tests_properties (HL_TOOLS_h52gif PROPERTIES - FIXTURES_REQUIRED clear_tools_hl -) - -add_test (NAME HL_TOOLS_h52gif_none COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $ testfiles/h52giftst.h5 image.gif -i nosuch_image) -set_tests_properties (HL_TOOLS_h52gif_none PROPERTIES - WILL_FAIL "true" - FIXTURES_REQUIRED clear_tools_hl -) - -#add_test (NAME HL_TOOLS_h52gifpal COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $ testfiles/h52giftst.h5 image.gif -i palette) -#set_tests_properties (HL_TOOLS_h52gifpal PROPERTIES -# WILL_FAIL "true" -# FIXTURES_REQUIRED clear_tools_hl -#) - -add_test (NAME HL_TOOLS_h52gif24bits COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $ testfiles/ex_image2.h5 image24.gif -i image24bitpixel) -set_tests_properties (HL_TOOLS_h52gif24bits PROPERTIES - WILL_FAIL "true" - FIXTURES_REQUIRED clear_tools_hl -) diff --git a/hl/tools/gif2h5/Makefile.am b/hl/tools/gif2h5/Makefile.am deleted file mode 100644 index d8786f70060..00000000000 --- a/hl/tools/gif2h5/Makefile.am +++ /dev/null @@ -1,50 +0,0 @@ -# -# Copyright by The HDF Group. -# All rights reserved. -# -# This file is part of HDF5. The full HDF5 copyright notice, including -# terms governing use, modification, and redistribution, is contained in -# the COPYING file, which can be found at the root of the source code -# distribution tree, or in https://www.hdfgroup.org/licenses. -# If you do not have access to either file, you may request a copy from -# help@hdfgroup.org. -## -## Makefile.am -## Run automake to generate a Makefile.in from this file. -# -# HDF5 Library Makefile(.in) -# - -include $(top_srcdir)/config/commence.am - -# Include src and tools/lib directories -AM_CPPFLAGS+=-I$(top_srcdir)/src -I$(top_srcdir)/tools/lib -I$(top_srcdir)/hl/src - -# These are our main targets, the tools - -bin_PROGRAMS=gif2h5 h52gif - -# Add h52gif and gif2h5 specific linker flags here -h52gif_LDFLAGS = $(LT_STATIC_EXEC) $(AM_LDFLAGS) -gif2h5_LDFLAGS = $(LT_STATIC_EXEC) $(AM_LDFLAGS) - -gif2h5_SOURCES=gif2hdf.c gif2mem.c decompress.c gifread.c writehdf.c - -h52gif_SOURCES=hdf2gif.c hdfgifwr.c - - -# Programs all depend on the hdf5 library, the tools library, and the HL -# library. -LDADD=$(LIBH5_HL) $(LIBH5TOOLS) $(LIBHDF5) - -if BUILD_TESTS_CONDITIONAL - TEST_SCRIPT=h52giftest.sh - check_SCRIPTS=$(TEST_SCRIPT) - noinst_PROGRAMS=h52gifgentst - h52gifgentst_SOURCES=h52gifgentst.c -endif - -CHECK_CLEANFILES+=*.h5 -CHECK_CLEANFILES+=*.gif - -include $(top_srcdir)/config/conclude.am diff --git a/hl/tools/gif2h5/decompress.c b/hl/tools/gif2h5/decompress.c deleted file mode 100644 index 62a22922ff4..00000000000 --- a/hl/tools/gif2h5/decompress.c +++ /dev/null @@ -1,331 +0,0 @@ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * Copyright by The HDF Group. * - * All rights reserved. * - * * - * This file is part of HDF5. The full HDF5 copyright notice, including * - * terms governing use, modification, and redistribution, is contained in * - * the COPYING file, which can be found at the root of the source code * - * distribution tree, or in https://www.hdfgroup.org/licenses. * - * If you do not have access to either file, you may request a copy from * - * help@hdfgroup.org. * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#include -#include - -#include "gif.h" - -GIFWORD iWIDE, iHIGH, eWIDE, eHIGH, expand, numcols, strip, nostrip; -unsigned long cols[256]; -char *cmd; - -FILE *fp; - -static GIFWORD XC = 0, YC = 0, /* Output X and Y coords of current pixel */ - InitCodeSize, /* Starting code size, used during Clear */ - CodeSize, /* Code size, read from GIF header */ - BytesPerScanline, /* Bytes per scanline in output raster */ - IWidth, IHeight; /* image dimensions */ -static int BitOffset = 0, /* Bit Offset of next code */ - Pass = 0, /* Used by output routine if GIFWORDerlaced pic */ - OutCount = 0, /* Decompressor output 'stack count' */ - Code, /* Value returned by ReadCode */ - MaxCode, /* limiting value for current code size */ - ClearCode, /* GIF clear code */ - EOFCode, /* GIF end-of-information code */ - CurCode, OldCode, InCode, /* Decompressor variables */ - FirstFree, /* First free code, generated per GIF spec */ - FreeCode, /* Decompressor, next free slot in hash table */ - FinChar, /* Decompressor variable */ - DataMask, /* AND mask for data size */ - ReadMask; /* Code AND mask for current code size */ - -/*MODIFICATIONS*/ -GIFBYTE tempbyte[10]; -GIFBYTE *tempGIFBYTEptr[10]; -GIFWORD tempint[10]; -GIFWORD ImageCount = 0; -/*END MODIFICATION*/ - -boolean Interlace, HasColormap; - -GIFBYTE *Image; /* The result array */ -GIFBYTE *RawGIF; /* The heap array to hold it, raw */ -GIFBYTE *Raster; /* The raster data stream, unblocked */ - -/* The hash table used by the decompressor */ - -static int *Prefix; -static int *Suffix; - -/* An output array used by the decompressor */ - -int *OutCode; - -/* The color map, read from the GIF header */ - -int numused; - -/* - * Fetch the next code from the raster data stream. The codes can be any - * length from 3 to 12 bits, packed into 8-bit GIFBYTEs, so we have to maintain - * our location in the Raster array as a BIT Offset. We compute the GIFBYTE - * Offset into the raster array by dividing this by 8, pick up three GIFBYTEs, - * compute the bit Offset into our 24-bit chunk, shift to bring the desired - * code to the bottom, then mask it off and return it. - */ -static int -ReadCode(void) -{ - int RawCode, ByteOffset; - - ByteOffset = BitOffset / 8; - RawCode = Raster[ByteOffset] + (0x100 * Raster[ByteOffset + 1]); - - if (CodeSize >= 8) - RawCode += (0x10000 * Raster[ByteOffset + 2]); - - RawCode >>= (BitOffset % 8); - BitOffset += (int)CodeSize; - return (RawCode & ReadMask); -} - -static void -AddToPixel(GIFBYTE Index) -{ - if (YC < IHeight) - *(Image + YC * BytesPerScanline + XC) = Index; - - /* Update the X-coordinate, and if it overflows, update the - * Y-coordinate */ - if (++XC == IWidth) { - /* - * If a non-interlaced picture, just increment YC to the next scan - * line. If it's interlaced, deal with the interlace as described - * in the GIF spec. Put the decoded scan line out to the screen if we - * haven't gone past the bottom of it. - */ - XC = 0; - - if (!Interlace) { - YC++; - } - else { - switch (Pass) { - case 0: - YC += 8; - - if (YC >= IHeight) { - Pass++; - YC = 4; - } - - break; - case 1: - YC += 8; - - if (YC >= IHeight) { - Pass++; - YC = 2; - } - - break; - case 2: - YC += 4; - - if (YC >= IHeight) { - Pass++; - YC = 1; - } - - break; - case 3: - YC += 2; - break; - default: - break; - } - } - } -} - -/* Main routine. Convert a GIF image to an HDF image */ - -GIFBYTE * -Decompress(GIFIMAGEDESC *GifImageDesc, GIFHEAD *GifHead) -{ - int i; - - if (!(Prefix = calloc(4096, sizeof(int)))) { - printf("Out of memory"); - exit(EXIT_FAILURE); - } - if (!(Suffix = calloc(4096, sizeof(int)))) { - printf("Out of memory"); - exit(EXIT_FAILURE); - } - if (!(OutCode = calloc(1024, sizeof(int)))) { - printf("Out of memory"); - exit(EXIT_FAILURE); - } - - XC = 0; - YC = 0; - Pass = 0; - OutCount = 0; - BitOffset = 0; - - DataMask = (1 << ((GifHead->PackedField & 0x07) + 1)) - 1; - Raster = GifImageDesc->GIFImage; - - /* Check for image separator */ - - /* Now read in values from the image descriptor */ - IWidth = GifImageDesc->ImageWidth; - IHeight = GifImageDesc->ImageHeight; - Interlace = (uint8_t)(GifImageDesc->PackedField & 0x40); - - /* - * Note that I ignore the possible existence of a local color map. I'm - * told there aren't many files around that use them, and the spec says - * it's defined for future use. This could lead to an error reading some - * files. - */ - - /* - * Start reading the raster data. First we get the initial code size and - * compute decompressor constant values, based on this code size. - */ - - CodeSize = GifImageDesc->CodeSize; - ClearCode = (1 << CodeSize); - EOFCode = ClearCode + 1; - FreeCode = FirstFree = ClearCode + 2; - - /* - * The GIF spec has it that the code size is the code size used to compute - * the above values is the code size given in the file, but the code size - * used in compression/decompression is the code size given in the file - * plus one. (thus the ++). - */ - - CodeSize++; - InitCodeSize = CodeSize; - MaxCode = (1 << CodeSize); - ReadMask = MaxCode - 1; - - /* - * Read the raster data. Here we just transpose it from the GIF array to - * the Raster array, turning it from a series of blocks into one long - * data stream, which makes life much easier for ReadCode(). - */ - - /* Allocate the Image */ - - if (!(Image = (GIFBYTE *)malloc((size_t)IWidth * (size_t)IHeight))) { - printf("Out of memory"); - exit(EXIT_FAILURE); - } - - BytesPerScanline = IWidth; - - /* - * Decompress the file, continuing until you see the GIF EOF code. One - * obvious enhancement is to add checking for corrupt files here. - */ - - Code = ReadCode(); - - while (Code != EOFCode) { - /* - * Clear code sets everything back to its initial value, then reads - * the immediately subsequent code as uncompressed data. - */ - if (Code == ClearCode) { - CodeSize = InitCodeSize; - MaxCode = (1 << CodeSize); - ReadMask = MaxCode - 1; - FreeCode = FirstFree; - CurCode = OldCode = Code = ReadCode(); - FinChar = CurCode & DataMask; - AddToPixel((GIFBYTE)FinChar); - } - else { - /* - * If not a clear code, then must be data: save same as CurCode - * and InCode - */ - CurCode = InCode = Code; - - /* - * If greater or equal to FreeCode, not in the hash table yet; - * repeat the last character decoded - */ - if (CurCode >= FreeCode) { - CurCode = OldCode; - OutCode[OutCount++] = FinChar; - } - - /* - * Unless this code is raw data, pursue the chain pointed to by - * CurCode through the hash table to its end; each code in the - * chain puts its associated output code on the output queue. - */ - while (CurCode > DataMask) { - if (OutCount >= 1024) { - /*return error message*/ - } - - OutCode[OutCount++] = Suffix[CurCode]; - CurCode = Prefix[CurCode]; - } - - /* The last code in the chain is treated as raw data. */ - FinChar = CurCode & DataMask; - OutCode[OutCount++] = FinChar; - - /* - * Now we put the data out to the Output routine. It's been - * stacked LIFO, so deal with it that way... - */ - for (i = OutCount - 1; i >= 0; i--) - AddToPixel((GIFBYTE)OutCode[i]); - - OutCount = 0; - - /* - * Build the hash table on-the-fly. No table is stored in the - * file. - */ - if (FreeCode >= 4096) { - printf("Error: FreeCode out of bounds\n"); - exit(EXIT_FAILURE); - } - Prefix[FreeCode] = OldCode; - Suffix[FreeCode] = FinChar; - OldCode = InCode; - - /* - * Point to the next slot in the table. If we exceed the current - * MaxCode value, increment the code size unless it's already 12. - * If it is, do nothing: the next code decompressed better be - * CLEAR - */ - FreeCode++; - - if (FreeCode >= MaxCode) - if (CodeSize < 12) { - CodeSize++; - MaxCode *= 2; - ReadMask = (1 << CodeSize) - 1; - } - } - - Code = ReadCode(); - } - - free(Prefix); - free(Suffix); - free(OutCode); - - return Image; -} diff --git a/hl/tools/gif2h5/gif.h b/hl/tools/gif2h5/gif.h deleted file mode 100644 index 62f09a5b2ee..00000000000 --- a/hl/tools/gif2h5/gif.h +++ /dev/null @@ -1,183 +0,0 @@ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * Copyright by The HDF Group. * - * All rights reserved. * - * * - * This file is part of HDF5. The full HDF5 copyright notice, including * - * terms governing use, modification, and redistribution, is contained in * - * the COPYING file, which can be found at the root of the source code * - * distribution tree, or in https://www.hdfgroup.org/licenses. * - * If you do not have access to either file, you may request a copy from * - * help@hdfgroup.org. * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - -/* - * Title: GIF.H - * Purpose: GIF Header file - */ -#ifndef GIF_H_ -#define GIF_H_ 1 - -#include -#include -#include - -#include "hdf5.h" - -#define MAX_PAL 768 - -/* typedef H5T_NATIVE_UINT8 GIFBYTE; */ -typedef unsigned char GIFBYTE; - -/* typedef H5T_NATIVE_UINT16 GIFWORD; */ -typedef unsigned long GIFWORD; - -typedef char GIFCHAR; - -#ifndef boolean -typedef unsigned char boolean; -#endif - -#ifndef false -#define false 0 -#endif -#ifndef true -#define true 1 -#endif - -/* Set the EndianOrder. -** The GIF Reader file should do this. -** Set EndianOrder = 0 if machine is little endian -** EndianOrder = 1 if machine is big endian. -*/ -extern int EndianOrder; - -/* -** The GIF header format. -** -** This structure actually contains the header, logical screen -** descriptor, and the global color table for the GIF image. -*/ -typedef struct _GifHeader { /* Offset Description */ - GIFBYTE PackedField; /* 0Ah Color Information */ - GIFWORD TableSize; - GIFBYTE ImageCount; /* Keep a count of the number of images */ - GIFBYTE CommentCount; - GIFBYTE ApplicationCount; - GIFBYTE PlainTextCount; - GIFBYTE HDFPalette[256][3]; - GIFBYTE HeaderDump[6]; /* GIFBYTE array to dump header contents */ - GIFBYTE LSDDump[7]; /* Logical Screen Descriptor dump */ -} GIFHEAD; - -/* -** The GIF Image Descriptor. -*/ -typedef struct _GifImageDescriptor { - GIFWORD ImageWidth; /* Width of the image in pixels */ - GIFWORD ImageHeight; /* Height of the image in pixels */ - GIFBYTE PackedField; /* Image and Color Table Data Information */ - GIFWORD TableSize; - GIFWORD CodeSize; /* Minimum LZW CodeSize for image data */ - GIFBYTE HDFPalette[256][3]; - GIFBYTE GIDDump[9]; /* GifImageDescriptor dump */ - - GIFBYTE *Image; /* Decompressed Raster Image */ - GIFBYTE *GIFImage; -} GIFIMAGEDESC; - -/* -** GIF 89a Graphic Control Extension Block -*/ -typedef struct _GifGraphicControlExtension { - GIFBYTE GCEDump[5]; /* Graphic Control Extension Dump */ -} GIFGRAPHICCONTROL; - -/* -** GIF 89a Plain Text Extension Block -*/ -typedef struct _GifPlainTextExtension { - GIFBYTE PTEDump[15]; /* Plain Text Extension Dump */ - GIFBYTE *PlainTextData; /* Plain Text data sub-blocks */ - GIFWORD DataSize; -} GIFPLAINTEXT; - -/* -** GIF 89a Application Extension Block -*/ -typedef struct _GifApplicationExtension { - GIFBYTE AEDump[14]; /* Application Extension Dump */ - GIFBYTE *ApplicationData; /* Application data sub-blocks */ - GIFWORD DataSize; -} GIFAPPLICATION; - -/* -** GIF 89a Comment Extension Block -*/ -typedef struct _GifCommentExtension { - GIFBYTE CEDump[2]; /* Comment Extension Dump */ - GIFBYTE *CommentData; /* Comment data sub-blocks */ - GIFWORD DataSize; - GIFBYTE Terminator; /* Block Terminator (always 0) */ -} GIFCOMMENT; - -/* -** GIF to HDF Memory Struct -** Purpose : The gif to hdf structure is used to pass all the -** gif data to the memory, which gets caught by the hdf driver -** Its the drivers job to put the data in the appropriate places -** in the HDF file. -** I have assumed that the ImageDescriptors and GraphicControls follow -** one another, ie. I have not associated them with each other. The driver -** must assume a 1-1 correspondence. The same discussion with plain text -** extension. -*/ -typedef struct _GifToMem { - GIFHEAD *GifHeader; - GIFIMAGEDESC **GifImageDesc; - GIFGRAPHICCONTROL **GifGraphicControlExtension; - GIFPLAINTEXT **GifPlainTextExtension; - GIFAPPLICATION **GifApplicationExtension; - GIFCOMMENT **GifCommentExtension; -} GIFTOMEM; - -/* -** Function Prototypes -*/ - -/* GIF2MEM.C */ -int Gif2Mem(GIFBYTE *, GIFTOMEM *); - -/* GIFREAD.C */ -int ReadGifHeader(GIFHEAD *, GIFBYTE **); -int ReadGifImageDesc(GIFIMAGEDESC *, GIFBYTE **); -int ReadGifGraphicControl(GIFGRAPHICCONTROL *, GIFBYTE **); -int ReadGifPlainText(GIFPLAINTEXT *, GIFBYTE **); -int ReadGifApplication(GIFAPPLICATION *, GIFBYTE **); -int ReadGifComment(GIFCOMMENT *, GIFBYTE **); - -/* HDFGIFWR.C */ -int hdfWriteGIF(FILE *fp, GIFBYTE *pic, int ptype, int w, int h, const GIFBYTE *rmap, const GIFBYTE *gmap, - const GIFBYTE *bmap, const GIFBYTE *pc2ncmap, int numcols, int colorstyle, int BitsPerPixel); - -/* WRITEHDF.C */ -int WriteHDF(GIFTOMEM, GIFCHAR *); - -/* Function: ReadHDF -** Return: 0 on completion without error, -1 on error -** Input: GIFCHAR *h5_file - HDF file name -** GIFCHAR *dset_name - Name of the HDF Image dataset -** GIFCHAR *pal_name - Name of the HDF palette -** Output: GIFBYTE* data - the HDF Image to be converted -** GIFBYTE palette[256][3] - the corresponding palette -** hsize_t* image_size - the size of each dimension of the image -*/ -int ReadHDF(GIFBYTE **data, GIFBYTE palette[256][3], hsize_t *image_size, GIFCHAR *h5_file, - GIFCHAR *dset_name, GIFCHAR *pal_name); - -GIFBYTE *Decompress(GIFIMAGEDESC *, GIFHEAD *); -GIFBYTE GetByte(const GIFBYTE *); -GIFWORD GetWord(GIFBYTE *); - -void cleanup(GIFBYTE *); - -#endif /* GIF_H_ */ diff --git a/hl/tools/gif2h5/gif2hdf.c b/hl/tools/gif2h5/gif2hdf.c deleted file mode 100644 index 161761c7ee4..00000000000 --- a/hl/tools/gif2h5/gif2hdf.c +++ /dev/null @@ -1,152 +0,0 @@ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * Copyright by The HDF Group. * - * All rights reserved. * - * * - * This file is part of HDF5. The full HDF5 copyright notice, including * - * terms governing use, modification, and redistribution, is contained in * - * the COPYING file, which can be found at the root of the source code * - * distribution tree, or in https://www.hdfgroup.org/licenses. * - * If you do not have access to either file, you may request a copy from * - * help@hdfgroup.org. * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#include -#include -#include - -#include "gif.h" -#include "h5tools.h" -#include "h5tools_utils.h" - -int -main(int argv, char *argc[]) -{ - GIFTOMEM GifMemoryStruct; - GIFIMAGEDESC gifImageDesc; - - FILE *fpGif; - - /* replacing int32 with long */ - long i, ImageCount; - HDoff_t filesize; - - GIFBYTE *MemGif; - GIFBYTE *StartPos; - - char *GIFFileName; - char *HDFFileName; - - /* - * Initialize all GifMemoryStruct pointers to null to prevent hassles - * later on - */ - GifMemoryStruct.GifHeader = NULL; - GifMemoryStruct.GifImageDesc = NULL; - GifMemoryStruct.GifGraphicControlExtension = NULL; - GifMemoryStruct.GifPlainTextExtension = NULL; - GifMemoryStruct.GifApplicationExtension = NULL; - GifMemoryStruct.GifCommentExtension = NULL; - - /* Initialize h5tools lib */ - h5tools_init(); - - if (argc[1] && (strcmp("-V", argc[1]) == 0)) { - print_version("gif2h5"); - exit(EXIT_SUCCESS); - } - - if (argv < 3) { - printf("Usage: gif2h5 \n"); - fprintf(stdout, " gif2h5 -V \n"); - fprintf(stdout, " Print HDF5 library version and exit\n"); - exit(EXIT_FAILURE); - } - - GIFFileName = argc[1]; - HDFFileName = argc[2]; - - if (!(fpGif = fopen(GIFFileName, "rb"))) { - printf("Unable to open GIF file for reading.\n"); - exit(EXIT_FAILURE); - } - - /* Get the whole file into memory. Mem's much faster than I/O */ - fseek(fpGif, 0L, 2); - filesize = HDftell(fpGif); - fseek(fpGif, 0L, 0); - - if (filesize == 0) - printf("File Size Zero"); - - if (!(MemGif = StartPos = (GIFBYTE *)malloc((size_t)filesize))) { - printf("Out of memory"); - exit(EXIT_FAILURE); - } - - if (fread(MemGif, (size_t)filesize, 1, fpGif) != 1) { - printf("Corrupted Input File"); - exit(EXIT_FAILURE); - } - - fseek(fpGif, 0L, 0); - - /* - * Call Gif2Mem and break the whole file into parts. Gif2Mem also calls - * decompresses the images so we don't have to worry about that - */ - Gif2Mem(MemGif, &GifMemoryStruct); - - if (ferror(fpGif)) { - printf("File Stream Error\n\n"); - exit(EXIT_FAILURE); - } - - fclose(fpGif); - - /* - * Call WriteHDF from here. Go ahead and change WriteHDF to write whatever - * format you want - */ - if (WriteHDF(GifMemoryStruct, HDFFileName)) - printf("HDF Write Error\n\n"); - - /* Free all buffers */ - /* replacing int32 with long */ - ImageCount = (long)((GifMemoryStruct.GifHeader)->ImageCount); - - for (i = 0; i < ImageCount; i++) { - gifImageDesc = *(GifMemoryStruct.GifImageDesc[i]); - - if (gifImageDesc.Image != NULL) - free(gifImageDesc.Image); - - if (GifMemoryStruct.GifImageDesc[i] != NULL) { - free(GifMemoryStruct.GifImageDesc[i]); - GifMemoryStruct.GifImageDesc[i] = NULL; - } - - if (GifMemoryStruct.GifGraphicControlExtension[i] != NULL) { - free(GifMemoryStruct.GifGraphicControlExtension[i]); - GifMemoryStruct.GifGraphicControlExtension[i] = NULL; - } - } - - free(StartPos); - if (GifMemoryStruct.GifHeader != NULL) { - free(GifMemoryStruct.GifHeader); - GifMemoryStruct.GifHeader = NULL; - } - if (GifMemoryStruct.GifApplicationExtension != NULL) { - free(GifMemoryStruct.GifApplicationExtension); - GifMemoryStruct.GifApplicationExtension = NULL; - } - if (GifMemoryStruct.GifImageDesc != NULL) { - free(GifMemoryStruct.GifImageDesc); - GifMemoryStruct.GifImageDesc = NULL; - } - if (GifMemoryStruct.GifGraphicControlExtension != NULL) { - free(GifMemoryStruct.GifGraphicControlExtension); - GifMemoryStruct.GifGraphicControlExtension = NULL; - } - - return EXIT_SUCCESS; -} diff --git a/hl/tools/gif2h5/gif2mem.c b/hl/tools/gif2h5/gif2mem.c deleted file mode 100644 index 1471bb7993a..00000000000 --- a/hl/tools/gif2h5/gif2mem.c +++ /dev/null @@ -1,330 +0,0 @@ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * Copyright by The HDF Group. * - * All rights reserved. * - * * - * This file is part of HDF5. The full HDF5 copyright notice, including * - * terms governing use, modification, and redistribution, is contained in * - * the COPYING file, which can be found at the root of the source code * - * distribution tree, or in https://www.hdfgroup.org/licenses. * - * If you do not have access to either file, you may request a copy from * - * help@hdfgroup.org. * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - -/* - * This file contains snippets of code from James Murray's original file to - * display the GIF header information, but most of it has been modified to - * suit gif2hdf - */ - -/****************************************************************************\ -** Title: GIFHEAD.C ** -** Purpose: Display the data in a GIF image file. ** -** Version: 1.0 ** -** C Compilers: Borland C++ v2.0, Microsoft C v6.00a ** -** ** -** GIFHEAD displays all real information contained within a GIF image ** -** file, including all color tables and extension block information. ** -** GIFHEAD reads both GIF 87a abd 89a-format files. ** -** ** -** Copyright (C) 1991-92 by Graphics Software Labs. All rights reserved. ** -\****************************************************************************/ -#include - -#include "gif.h" - -int -Gif2Mem(GIFBYTE *MemGif, GIFTOMEM *GifMemoryStruct) -{ - /* - * The gif structure outline for passing data to memory is given in gif.h. - * These pointers are redundant, should take them out in ver. 2 - */ - GIFHEAD *gifHead; /* GIF Header structure */ - GIFIMAGEDESC **gifImageDesc; /* Logical Image Descriptor struct */ - GIFPLAINTEXT **gifPlainText; /* Plain Text Extension structure */ - GIFAPPLICATION **gifApplication; /* Application Extension structure */ - GIFCOMMENT **gifComment; /* Comment Extension structure */ - GIFGRAPHICCONTROL **gifGraphicControl; /* Graphic Control Extension strct */ - - GIFWORD i; /* Loop counter */ - GIFBYTE Identifier; /* Extension block identifier holder */ - GIFBYTE Label; /* Extension block label holder */ - GIFBYTE ImageCount; /* Count of the number of images in the file */ - GIFBYTE ImageArray; /* Keep the size of the array to store Images */ - GIFBYTE CommentCount; - GIFBYTE CommentArray; - GIFBYTE ApplicationCount; - GIFBYTE ApplicationArray; - GIFBYTE PlainTextCount; - GIFBYTE PlainTextArray; - GIFBYTE GCEflag; - GIFBYTE aTemp; - GIFBYTE j; - GIFBYTE w; /* Two more variables needed only while testing */ - GIFBYTE *b; /* Endian Ordering */ - - /* Allocate memory for the GIF structures */ - /* Plug the structs into GifMemoryStruct at the end */ - /****************************************************/ - if (!(gifHead = (GIFHEAD *)malloc(sizeof(GIFHEAD)))) { - printf("Could not allocate memory for gifHead\n"); - exit(EXIT_FAILURE); - } - - /* - * The next three have to grow dynamically so we leave them for now and - * let realloc handle it later on. - */ - gifImageDesc = NULL; - gifPlainText = NULL; - gifGraphicControl = NULL; - gifComment = NULL; - gifApplication = NULL; - - /******************************/ - /* Memory allocation complete */ - /******************************/ - - /* Carry out Endian Testing and set Endian Order */ - w = 0x0001; - b = (GIFBYTE *)&w; - EndianOrder = (b[0] ? 1 : 0); - - /* Read the GIF image file header information */ - ReadGifHeader(gifHead, &MemGif); - - /* Check for FILE stream error */ -#if 0 - if (ferror(fpGif)) - { - fputs("GIFHEAD: Error reading header information!\n", stderr); - exit(EXIT_FAILURE); - } -#endif /* 0 */ - - /* - * Identify, read, and display block information. - */ - ImageCount = ImageArray = 0; - CommentCount = CommentArray = 0; - ApplicationCount = ApplicationArray = 0; - PlainTextCount = PlainTextArray = 0; - GCEflag = 0; - - for (;;) { - Identifier = *MemGif++; - - switch (Identifier) { - case 0x3B: /* Trailer */ - /* - * The counts are stored to make it easier while putting stuff - * into the HDF file and then deallocating space. - */ - gifHead->ImageCount = ImageCount; - gifHead->CommentCount = CommentCount; - gifHead->ApplicationCount = ApplicationCount; - gifHead->PlainTextCount = PlainTextCount; - - /* putting stuff into the gif2mem structure */ - GifMemoryStruct->GifHeader = gifHead; - GifMemoryStruct->GifImageDesc = gifImageDesc; - GifMemoryStruct->GifPlainTextExtension = gifPlainText; - GifMemoryStruct->GifApplicationExtension = gifApplication; - GifMemoryStruct->GifCommentExtension = gifComment; - GifMemoryStruct->GifGraphicControlExtension = gifGraphicControl; - - /* return the struct */ - return 0; - - case 0x2C: /* Image Descriptor */ - /* - * If there was no image descriptor before this increase image - * count. If an imagedescriptor was present, reset GCEflag - */ - if (GCEflag == 0) - ImageCount++; - else - GCEflag = 0; - - if (ImageCount > ImageArray) { - aTemp = ImageArray; - ImageArray = (GIFBYTE)((ImageArray << 1) + 1); - if (!(gifImageDesc = - (GIFIMAGEDESC **)realloc(gifImageDesc, sizeof(GIFIMAGEDESC *) * ImageArray))) { - printf("Out of memory!"); - exit(EXIT_FAILURE); - } - - if (!(gifGraphicControl = (GIFGRAPHICCONTROL **)realloc( - gifGraphicControl, sizeof(GIFGRAPHICCONTROL *) * ImageArray))) { - printf("Out of memory!"); - exit(EXIT_FAILURE); - } - - for (j = aTemp; j < ImageArray; j++) { - gifGraphicControl[j] = NULL; - gifImageDesc[j] = NULL; - } - } - - if (!(gifImageDesc[ImageCount - 1] = (GIFIMAGEDESC *)malloc(sizeof(GIFIMAGEDESC)))) { - printf("Out of memory!"); - exit(EXIT_FAILURE); - } - - if (ReadGifImageDesc(gifImageDesc[ImageCount - 1], &MemGif) == -1) - fputs("Error reading Image Descriptor information\n", stderr); - - /* Decompress the Image */ - gifImageDesc[ImageCount - 1]->Image = Decompress(gifImageDesc[ImageCount - 1], gifHead); - free(gifImageDesc[ImageCount - 1]->GIFImage); - - /* - * Convert the local palette into an HDF compatible palette In - * case the local color table is present, it is written out as - * the HDFPalette If it is absent the global table is written - * as the HDFPalette. - */ - if (!((gifImageDesc[ImageCount - 1]->PackedField) & 0x80)) { - /* Check to see if the global color table exists.... */ - if (gifHead->PackedField & 0x80) { - for (i = 0; i < gifHead->TableSize; i++) { - gifImageDesc[ImageCount - 1]->HDFPalette[i][0] = gifHead->HDFPalette[i][0]; - gifImageDesc[ImageCount - 1]->HDFPalette[i][1] = gifHead->HDFPalette[i][1]; - gifImageDesc[ImageCount - 1]->HDFPalette[i][2] = gifHead->HDFPalette[i][2]; - } - } - - gifImageDesc[ImageCount - 1]->TableSize = gifHead->TableSize; - } - - break; - - case 0x21: /* Extension Block */ - Label = *MemGif++; - - switch (Label) { - case 0x01: /* Plain Text Extension */ - puts("Plain Text Extension\n"); - PlainTextCount++; - - if (PlainTextCount > PlainTextArray) - PlainTextArray = (GIFBYTE)((PlainTextArray << 1) + 1); - - if (!(gifPlainText = (GIFPLAINTEXT **)realloc(gifPlainText, sizeof(GIFPLAINTEXT *) * - PlainTextArray))) { - printf("Out of memory!"); - exit(EXIT_FAILURE); - } - - if (!(gifPlainText[PlainTextCount - 1] = - (GIFPLAINTEXT *)malloc(sizeof(GIFPLAINTEXT)))) { - printf("Out of memory!"); - exit(EXIT_FAILURE); - } - - if (ReadGifPlainText(gifPlainText[PlainTextCount - 1], &MemGif)) - fprintf(stderr, "Error reading Plain Text Extension information.\n"); - - break; - - case 0xFE: /* Comment Extension */ - CommentCount++; - - if (CommentCount > CommentArray) - CommentArray = (GIFBYTE)((CommentArray << 1) + 1); - - if (!(gifComment = - (GIFCOMMENT **)realloc(gifComment, sizeof(GIFCOMMENT *) * CommentArray))) { - printf("Out of memory!"); - exit(EXIT_FAILURE); - } - - if (!(gifComment[CommentCount - 1] = (GIFCOMMENT *)malloc(sizeof(GIFCOMMENT)))) { - printf("Out of memory!"); - exit(EXIT_FAILURE); - } - - if (ReadGifComment(gifComment[CommentCount - 1], &MemGif)) - fprintf(stderr, "Error reading Comment Extension information\n"); - - break; - - case 0xF9: /* Graphic Control Extension */ - if (GCEflag == 0) - ImageCount++; - - GCEflag = 1; - - if (ImageCount > ImageArray) { - aTemp = ImageArray; - ImageArray = (GIFBYTE)((ImageArray << 1) + 1); - - if (!(gifGraphicControl = (GIFGRAPHICCONTROL **)realloc( - gifGraphicControl, sizeof(GIFGRAPHICCONTROL *) * ImageArray))) { - printf("Out of memory!"); - exit(EXIT_FAILURE); - } - - if (!(gifImageDesc = (GIFIMAGEDESC **)realloc( - gifImageDesc, sizeof(GIFIMAGEDESC *) * ImageArray))) { - printf("Out of memory!"); - exit(EXIT_FAILURE); - } - - for (j = aTemp; j < ImageArray; j++) { - gifGraphicControl[j] = NULL; - gifImageDesc[j] = NULL; - } - } - - if (!(gifGraphicControl[ImageCount - 1] = - (GIFGRAPHICCONTROL *)malloc(sizeof(GIFGRAPHICCONTROL)))) { - printf("Out of memory!"); - exit(EXIT_FAILURE); - } - - if (ReadGifGraphicControl(gifGraphicControl[ImageCount - 1], &MemGif)) - fprintf(stderr, "Error reading Graphic Control Extension information\n"); - - (*MemGif)++; - if ((!*MemGif) == 0) - fprintf(stderr, "Error reading Graphic Control Extension\n"); - - break; - - case 0xFF: /* Application Extension */ - ApplicationCount++; - - if (ApplicationCount > ApplicationArray) - ApplicationArray = (GIFBYTE)((ApplicationArray << 1) + 1); - - if (!(gifApplication = (GIFAPPLICATION **)realloc( - gifApplication, sizeof(GIFAPPLICATION *) * ApplicationArray))) { - printf("Out of memory!"); - exit(EXIT_FAILURE); - } - - if (!(gifApplication[ApplicationCount - 1] = - (GIFAPPLICATION *)malloc(sizeof(GIFAPPLICATION)))) { - printf("Out of memory!"); - exit(EXIT_FAILURE); - } - - if (ReadGifApplication(gifApplication[ApplicationCount - 1], &MemGif)) - fprintf(stderr, "Error reading Application Extension information\n"); - - break; - - default: - printf("Unknown Extension Label: %#02x\n", Label); - break; - } - - break; - - default: - fprintf(stderr, "Unknown Block Separator Character: %#02x\n", Identifier); - } - } -} diff --git a/hl/tools/gif2h5/gifread.c b/hl/tools/gif2h5/gifread.c deleted file mode 100644 index 5fb1fd5428a..00000000000 --- a/hl/tools/gif2h5/gifread.c +++ /dev/null @@ -1,376 +0,0 @@ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * Copyright by The HDF Group. * - * All rights reserved. * - * * - * This file is part of HDF5. The full HDF5 copyright notice, including * - * terms governing use, modification, and redistribution, is contained in * - * the COPYING file, which can be found at the root of the source code * - * distribution tree, or in https://www.hdfgroup.org/licenses. * - * If you do not have access to either file, you may request a copy from * - * help@hdfgroup.org. * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#include -#include - -#include "gif.h" - -int EndianOrder; - -static GIFBYTE *ReadDataSubBlocks(GIFBYTE **MemGif2, GIFWORD *DSize); - -GIFWORD -GetWord(GIFBYTE *MemGif) -{ - GIFWORD w; - - if (EndianOrder == 1) { - /* LittleEndian */ - w = (GIFWORD)(*MemGif++ & 0xFF); - w |= (GIFWORD)((*MemGif++ & 0xFF) << 0x08); - } - else { - w = (GIFWORD)(*MemGif++ & 0xFF); - w = ((GIFWORD)(*MemGif++ & 0xFF)) | (w << 0x08); - } - - return w; -} - -GIFBYTE -GetByte(const GIFBYTE *MemGif) -{ - return *MemGif; -} - -/* - * Read a GIF image GIFBYTE Header. - * - * This function reads the Header, Logical Screen Descriptor, and - * Global Color Table (if any) from a GIF image file. The information - * is stored in a GIFHEAD structure. - * - * Returns: -1 if a FILE stream error occurred during the read, - * otherwise 0 if no error occurred. - */ -int -ReadGifHeader(GIFHEAD *GifHead, /* Pointer to GIF header structure */ - GIFBYTE **MemGif2) /* GIF image file input FILE stream */ -{ - GIFWORD i; /* Loop counter */ - GIFWORD tableSize; /* Number of entries in the Global Color Table */ - - GifHead->TableSize = 0; - for (i = 0; i < 6; i++) { - GifHead->HeaderDump[i] = *(*MemGif2)++; - } - - if (strncmp((const char *)GifHead->HeaderDump, "GIF", (size_t)3) != 0) { - printf("The file does not appear to be a valid GIF file.\n"); - exit(EXIT_FAILURE); - } - - for (i = 0; i < 7; i++) { - GifHead->LSDDump[i] = *(*MemGif2)++; - } - - GifHead->PackedField = GifHead->LSDDump[4]; - - /* Check if a Global Color Table is present */ - if (GifHead->PackedField & 0x80) { - /* Read number of color table entries */ - tableSize = (GIFWORD)(1L << ((GifHead->PackedField & 0x07) + 1)); - GifHead->TableSize = tableSize; - - /* Read the Global Color Table */ - - /* - * There are some changes made here apart from just reading in the - * global color table as would seem intuitively obvious. The colors - * are stored in the bottom part of the palette as opposed to the top - */ - - for (i = 0; i < tableSize; i++) { - GifHead->HDFPalette[i][0] = *(*MemGif2)++; - GifHead->HDFPalette[i][1] = *(*MemGif2)++; - GifHead->HDFPalette[i][2] = *(*MemGif2)++; - } - } - - /* Check for a FILE stream error */ -#if 0 - if (ferror(FpGif)) - return -1; -#endif /* 0 */ - - return 0; /* No FILE stream error occurred */ -} - -/* -** Read a GIF Local Image Descriptor. -** -** This function reads the Local Image Descriptor, and Local Color -** Table (if any) from a GIF image file. The information is stored -** in a GIFIMAGEDESC structure. -** -** Note that the ImageSeparator field value in the GIFIMAGEDESC -** structure is assigned by the function calling ReadGifImageDesc(). -** -** Returns: -1 if a FILE stream error occurred during the read, -** otherwise 0 if no error occurred. -*/ -int -ReadGifImageDesc(GIFIMAGEDESC *GifImageDesc, /* Pointer to GIF image descriptor structure */ - GIFBYTE **MemGif2 /* GIF image file input FILE stream */ -) -{ - GIFWORD i; /* Loop counter */ - GIFWORD tableSize; /* Number of entries in the Local Color Table */ - /* GIFBYTE Interlace; */ /* PackedField & 0x20 gives information on interlacing */ - GIFBYTE *TempPtr; - int ch, ch1; - - GifImageDesc->TableSize = 0; - for (i = 0; i < 9; i++) { - GifImageDesc->GIDDump[i] = *(*MemGif2)++; - } - - /* - ** Get the relevant fields. I need ImageWidth and Height actively hence I have - ** taken information from those fields. I intend to keep the GifImageDesc data - ** structure as it is so that anyone needing the rest of the fields can do so - ** quickly. - */ - - if (EndianOrder == 1) /* LittleEndian */ - { - GifImageDesc->ImageWidth = (GIFWORD)(GifImageDesc->GIDDump[4] & 0xFF); - GifImageDesc->ImageWidth |= (GIFWORD)((GifImageDesc->GIDDump[5] & 0xFF) << 0x08); - - GifImageDesc->ImageHeight = (GIFWORD)(GifImageDesc->GIDDump[6] & 0xFF); - GifImageDesc->ImageHeight |= (GIFWORD)((GifImageDesc->GIDDump[7] & 0xFF) << 0x08); - } - else { - GifImageDesc->ImageWidth = (GIFWORD)(GifImageDesc->GIDDump[4] & 0xFF); - GifImageDesc->ImageWidth = - ((GIFWORD)(GifImageDesc->GIDDump[5] & 0xFF)) | (GifImageDesc->ImageWidth << 0x08); - - GifImageDesc->ImageHeight = (GIFWORD)(GifImageDesc->GIDDump[6] & 0xFF); - GifImageDesc->ImageHeight = - ((GIFWORD)(GifImageDesc->GIDDump[7] & 0xFF)) | (GifImageDesc->ImageWidth << 0x08); - } - - GifImageDesc->PackedField = GifImageDesc->GIDDump[8]; - - /* Interlace = GifImageDesc->PackedField & 0x20; */ - - /* Check if a Local Color Table is present */ - if (GifImageDesc->PackedField & 0x80) { - /* Read number of color table entries */ - tableSize = (GIFWORD)(1L << ((GifImageDesc->PackedField & 0x07) + 1)); - GifImageDesc->TableSize = tableSize; - /* Read the Local Color Table */ - for (i = 0; i < tableSize; i++) { - GifImageDesc->HDFPalette[i][0] = *(*MemGif2)++; - GifImageDesc->HDFPalette[i][1] = *(*MemGif2)++; - GifImageDesc->HDFPalette[i][2] = *(*MemGif2)++; - } - } - - /* - ** Get LZW minimum Code Size - */ - GifImageDesc->CodeSize = (GIFWORD) * (*MemGif2)++; - - /*GifImageDesc->GIFImage = ReadDataSubBlocks(FpGif);*/ - if (!(GifImageDesc->GIFImage = - (GIFBYTE *)malloc((GifImageDesc->ImageWidth) * (GifImageDesc->ImageHeight)))) { - printf("Out of memory"); - exit(EXIT_FAILURE); - } - - TempPtr = GifImageDesc->GIFImage; - do { - ch = ch1 = (int)*(*MemGif2)++; - while (ch--) - *TempPtr++ = *(*MemGif2)++; - } while (ch1); - - return (0); /* No FILE stream error occurred */ -} - -/* -** Read a GIF Graphic Control Extension block. -** -** Note that the Introducer and Label field values in the GIFGRAPHICCONTROL -** structure are assigned by the function calling ReadGifGraphicControl(). -** -** Returns: -1 if a FILE stream error occurred during the read, -** otherwise 0 if no error occurred. -*/ -int -ReadGifGraphicControl(GIFGRAPHICCONTROL *GifGraphicControl, /* Pointer to GC Extension structure */ - GIFBYTE **MemGif2 /* GIF image file input FILE stream */ -) -{ - int i; - - for (i = 0; i < 5; i++) { - GifGraphicControl->GCEDump[i] = *(*MemGif2)++; - } - - return (0); /* No FILE stream error occurred */ -} - -/* -** Read a GIF Plain Text Extension block. -** -** Note that the Introducer and Label field values in the GIFLPLAINTEXT -** structure are assigned by the function calling ReadGifPlainText(). -** -** Returns: -1 if a FILE stream error occurred during the read, -** otherwise 0 if no error occurred. -*/ -int -ReadGifPlainText(GIFPLAINTEXT *GifPlainText, /* Pointer to Plain Text Extension structure */ - GIFBYTE **MemGif2 /* GIF image file input FILE stream */ -) -{ - int i; - - for (i = 0; i < 13; i++) { - GifPlainText->PTEDump[i] = *(*MemGif2)++; - } - - /* Read in the Plain Text data sub-blocks */ - if (!(GifPlainText->PlainTextData = ReadDataSubBlocks(MemGif2, &(GifPlainText->DataSize)))) - return (1); - - /* - GifPlainText->Terminator = 0; - */ - - /* Check for a FILE stream error */ - /* - if (ferror(FpGif)) - return(-1); - */ - - return (0); /* No FILE stream error occurred */ -} - -/* -** Read a GIF Application Extension block. -** -** Note that the Introducer and Label field values in the GIFAPPLICATION -** structure are assigned by the function calling ReadGifApplication(). -** -** Returns: -1 if a FILE stream error occurred during the read, -** otherwise 0 if no error occurred. -*/ -int -ReadGifApplication(GIFAPPLICATION *GifApplication, /* Pointer to Application Extension structure */ - GIFBYTE **MemGif2 /* GIF image file input FILE stream */ -) -{ - int i; - - for (i = 0; i < 12; i++) { - GifApplication->AEDump[i] = *(*MemGif2)++; - } - - /* Read in the Plain Text data sub-blocks */ - if (!(GifApplication->ApplicationData = ReadDataSubBlocks(MemGif2, &(GifApplication->DataSize)))) - return (1); - /* - GifApplication->Terminator = 0; - */ - - /* Check for a FILE stream error */ - /* - if (ferror(FpGif)) - return(-1); - */ - - return (0); /* No FILE stream error occurred */ -} - -/* -** Read a GIF Comment Extension block. -** -** Note that the Introducer and Label field values in the GIFCOMMENT -** structure are assigned by the function calling ReadGifComment(). -** -** Returns: -1 if a FILE stream error occurred during the read, -** otherwise 0 if no error occurred. -*/ -int -ReadGifComment(GIFCOMMENT *GifComment, /* Pointer to GIF Comment Extension structure */ - GIFBYTE **MemGif2 /* GIF image file input FILE stream */ -) -{ - - /* Read in the Plain Text data sub-blocks */ - if (!(GifComment->CommentData = ReadDataSubBlocks(MemGif2, &(GifComment->DataSize)))) - return (1); - - GifComment->Terminator = 0; - - return (0); /* No FILE stream error occurred */ -} - -/* -** Read one or more GIF data sub-blocks and write the information -** to a buffer. -** -** A GIF "sub-block" is a single count byte followed by 1 to 255 -** additional data bytes. -** -** Returns: A NULL pointer if a memory allocation error occurred, -** otherwise a valid pointer if no error occurred. -*/ -static GIFBYTE * -ReadDataSubBlocks(GIFBYTE **MemGif2, /* GIF image file input FILE stream */ - GIFWORD *DSize) -{ - GIFBYTE *ptr1; /* Pointer used to "walk the heap" */ - GIFBYTE *ptr2; /* Pointer used to mark the top of the heap */ - GIFBYTE dataSize; /* Size of the current data sub-block being read */ - GIFWORD bufSize; /* Total size of the Plain Text data buffer */ - int tempcount = 0; - - bufSize = 0; /* The output buffer is empty */ - - dataSize = *(*MemGif2)++; /* Get the size of the first sub-block */ - - /* Allocate initial data buffer */ - if (!(ptr1 = ptr2 = (GIFBYTE *)malloc((size_t)dataSize + 1))) { - printf("Out of memory. Allocation of memory for data sub-blocks for\neither Comment, Plain Text or " - "Application Extensions failed"); - return ((GIFBYTE *)NULL); - } - for (;;) { - tempcount++; - bufSize += (dataSize); /* Running total of the buffer size */ - *DSize = bufSize; - -#ifdef COMMENTED_OUT - *ptr1++ = dataSize; /* Write the data count */ -#endif /* COMMENTED_OUT */ - while (dataSize--) /* Read/write the Plain Text data */ - *ptr1++ = *(*MemGif2)++; - - /* Check if there is another data sub-block */ - if ((dataSize = *(*MemGif2)++) == 0) - break; /* Block Terminator encountered */ - - /* Increase the buffer size to accommodate the next sub-block */ - if (!(ptr1 = ptr2 = (GIFBYTE *)realloc(ptr2, bufSize + dataSize + 1))) - return ((GIFBYTE *)NULL); - - ptr1 += bufSize; /* Move pointer to the end of the data */ - } - - *ptr1++ = '\0'; - - return (ptr2); /* Return a pointer to the sub-block data */ -} diff --git a/hl/tools/gif2h5/h52gifgentst.c b/hl/tools/gif2h5/h52gifgentst.c deleted file mode 100644 index 4851145ec45..00000000000 --- a/hl/tools/gif2h5/h52gifgentst.c +++ /dev/null @@ -1,99 +0,0 @@ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * Copyright by The HDF Group. * - * All rights reserved. * - * * - * This file is part of HDF5. The full HDF5 copyright notice, including * - * terms governing use, modification, and redistribution, is contained in * - * the COPYING file, which can be found at the root of the source code * - * distribution tree, or in https://www.hdfgroup.org/licenses. * - * If you do not have access to either file, you may request a copy from * - * help@hdfgroup.org. * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - -#include -#include -#include -#include "hdf5.h" -#include "H5IMpublic.h" - -/*------------------------------------------------------------------------- - * Program: h52gifgentst - * - * Purpose: generate files for h52gif testing - * - *------------------------------------------------------------------------- - */ - -#define FILENAME "h52giftst.h5" -#define WIDTH 400 -#define HEIGHT 200 -#define PAL_ENTRIES 256 -#define IMAGE1_NAME "image" -#define PAL_NAME "palette" - -/*------------------------------------------------------------------------- - * Function: main - * - * Purpose: main program - * - *------------------------------------------------------------------------- - */ - -int -main(void) -{ - hid_t fid; - int i, j, n, space; - unsigned char *buf; - unsigned char pal[PAL_ENTRIES * 3]; /* palette array */ - hsize_t pal_dims[2] = {PAL_ENTRIES, 3}; /* palette dimensions */ - hsize_t width = WIDTH; - hsize_t height = HEIGHT; - - /* Allocate buffer */ - if (NULL == (buf = (unsigned char *)malloc(WIDTH * HEIGHT))) - return EXIT_FAILURE; - - /* create a file */ - if ((fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) - return EXIT_FAILURE; - - /* create an image */ - space = WIDTH * HEIGHT / PAL_ENTRIES; - for (i = 0, j = 0, n = 0; i < WIDTH * HEIGHT; i++, j++) { - buf[i] = (unsigned char)n; - if (j > space) { - n++; - j = 0; - } - } - - /* make the image */ - if (H5IMmake_image_8bit(fid, IMAGE1_NAME, width, height, buf) < 0) - return EXIT_FAILURE; - - /*------------------------------------------------------------------------- - * define a palette, blue to red tones - *------------------------------------------------------------------------- - */ - for (i = 0, n = 0; i < PAL_ENTRIES * 3; i += 3, n++) { - pal[i] = (unsigned char)n; /* red */ - pal[i + 1] = (unsigned char)0; /* green */ - pal[i + 2] = (unsigned char)(255 - n); /* blue */ - } - - /* make a palette */ - if (H5IMmake_palette(fid, PAL_NAME, pal_dims, pal) < 0) - return EXIT_FAILURE; - - /* attach the palette to the image */ - if (H5IMlink_palette(fid, IMAGE1_NAME, PAL_NAME) < 0) - return EXIT_FAILURE; - - if (H5Fclose(fid) < 0) - return EXIT_FAILURE; - - free(buf); - - return EXIT_SUCCESS; -} diff --git a/hl/tools/gif2h5/h52giftest.sh.in b/hl/tools/gif2h5/h52giftest.sh.in deleted file mode 100644 index bdc85c3f540..00000000000 --- a/hl/tools/gif2h5/h52giftest.sh.in +++ /dev/null @@ -1,95 +0,0 @@ -#!/bin/sh -# -# Copyright by The HDF Group. -# All rights reserved. -# -# This file is part of HDF5. The full HDF5 copyright notice, including -# terms governing use, modification, and redistribution, is contained in -# the COPYING file, which can be found at the root of the source code -# distribution tree, or in https://www.hdfgroup.org/licenses. -# If you do not have access to either file, you may request a copy from -# help@hdfgroup.org. -# -# HDF Utilities Test script - - -TESTFILE1="$srcdir/testfiles/h52giftst.h5" -TESTFILE2="$srcdir/testfiles/image1.gif" -TESTFILE3="$srcdir/testfiles/ex_image2.h5" - -# initialize errors variable -errors=0 - -TESTING() { - SPACES=" " - echo "Testing $* $SPACES" | cut -c1-70 | tr -d '\012' -} - - - -# Verify the test runs with success (return code is 0) -TOOLTEST() -{ - # for now, discard any error messages generated. - $RUNSERIAL $* > /dev/null 2>&1 - - RET=$? - if [ $RET = 0 ] ; then - echo " PASSED" - else - echo "*FAILED*" - errors="` expr $errors + 1 `"; - fi - -} - -# Verify the test runs with failure (return code is not 0) -# Use for testing if tool can handle error conditions like -# illegal input, bad arguments, exceeding limits, ... -TOOLTESTFAIL() -{ - # for now, discard any error messages generated. - $RUNSERIAL $* > /dev/null 2>&1 - - RET=$? - if [ $RET != 0 ] ; then - echo " PASSED" - else - echo "*FAILED*" - errors="` expr $errors + 1 `"; - fi -} - - -# Positive tests for gif2h5 -echo "**validate the gif2h5 tool processes input correctly..." -TESTING "./gif2h5 image1.gif image1.h5" -TOOLTEST ./gif2h5 $TESTFILE2 image1.h5 -echo "" - -# Positive tests for h52gif -echo "**validate the h52gif tool processes input correctly..." -TESTING "./h52gif h52giftst.h5 image1.gif -i image" -TOOLTEST ./h52gif $TESTFILE1 image1.gif -i image -echo "" - -# Negative tests. -echo "**verify that the h52gif tool handles error conditions correctly..." -# nonexisting dataset name -TESTING "./h52gif h52giftst.h5 image.gif -i nosuch_image" -TOOLTESTFAIL "./h52gif $TESTFILE1 image.gif -i nosuch_image" -# this test should have failed but it did not. Comment it out for now. -#TESTING "./h52gif h52giftst.h5 image.gif -i palette" -#TOOLTESTFAIL "./h52gif $TESTFILE1 image.gif -i palette" -TESTING "./h52gif h52giftst.h5 image24.gif -i image24bitpixel" -TOOLTESTFAIL "./h52gif $TESTFILE3 image24.gif -i image24bitpixel" -echo "" - -# all done. summarize results. -if test $errors -eq 0 ; then - echo "All gif2h5 and h52gif tests passed." - exit 0 -else - echo "Some gif2h5 or h52gif tests failed with $errors errors." - exit 1 -fi diff --git a/hl/tools/gif2h5/hdf2gif.c b/hl/tools/gif2h5/hdf2gif.c deleted file mode 100644 index 120e42e294c..00000000000 --- a/hl/tools/gif2h5/hdf2gif.c +++ /dev/null @@ -1,334 +0,0 @@ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * Copyright by The HDF Group. * - * All rights reserved. * - * * - * This file is part of HDF5. The full HDF5 copyright notice, including * - * terms governing use, modification, and redistribution, is contained in * - * the COPYING file, which can be found at the root of the source code * - * distribution tree, or in https://www.hdfgroup.org/licenses. * - * If you do not have access to either file, you may request a copy from * - * help@hdfgroup.org. * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - -#include -#include -#include "gif.h" -#include "H5IMpublic.h" -#include "h5tools.h" -#include "h5tools_utils.h" - -/* Name of tool */ -#define PROGRAMNAME "hdf2gif" - -#define IMAGE_WIDTH_MAX 65535 /* unsigned 16bits integer */ -#define IMAGE_HEIGHT_MAX 65535 /* unsigned 16bits integer */ - -int EndianOrder; - -static void -putword(int w, FILE *fp) -{ - /* writes a 16-bit integer in GIF order (LSB first) */ - fputc(w & 0xff, fp); - fputc((w >> 8) & 0xff, fp); -} - -static void -usage(void) -{ - printf("Usage: h52gif -i \n"); - fprintf(stdout, " h52gif -V \n"); - fprintf(stdout, " Print HDF5 library version and exit\n"); - printf("h52gif expects *at least* one h5_image.\n"); -} - -static void -leave(int ret) -{ - h5tools_close(); - exit(ret); -} - -static FILE *fpGif = NULL; -int -main(int argc, char **argv) -{ - GIFBYTE *Image; - - /* compression structs */ - GIFCHAR *HDFName = NULL; - GIFCHAR *GIFName = NULL; - - GIFBYTE *b; - - GIFBYTE GlobalPalette[256][3]; - GIFBYTE Red[256]; - GIFBYTE Green[256]; - GIFBYTE Blue[256]; - - int RWidth, RHeight; - int ColorMapSize, InitCodeSize, Background, BitsPerPixel; - int j, nc; - int i; - int numcols = 0; - - GIFBYTE pc2nc[256], r1[256], g1[256], b1[256]; - - int arg_index = 2; - int bool_is_image = 0; /* 0 = false , 1 = true */ - char *image_name = NULL; - int idx; - - h5tools_setprogname(PROGRAMNAME); - h5tools_setstatus(EXIT_SUCCESS); - - /* Initialize h5tools lib */ - h5tools_init(); - - if (argv[1] && (strcmp("-V", argv[1]) == 0)) { - print_version("gif2h5"); - h5tools_setstatus(EXIT_SUCCESS); - } - - if (argc < 4) { - /* they didn't supply at least one image -- bail */ - usage(); - h5tools_setstatus(EXIT_FAILURE); - } - - HDFName = argv[1]; - GIFName = argv[2]; - - /* get the options */ - while (arg_index++ < argc - 1) { - if (!strcmp(argv[arg_index], "-i")) { - bool_is_image = 1; - continue; - } - - if (bool_is_image) { - /* allocate space to store the image name */ - size_t len = strlen(argv[arg_index]); - image_name = (GIFCHAR *)malloc(len + 1); - strcpy(image_name, argv[arg_index]); - - bool_is_image = 0; - continue; - } - - /* oops. This was not meant to happen */ - usage(); - - goto out; - } - - /* Do Endian Order testing and set Endian Order */ - idx = 0x0001; - b = (GIFBYTE *)&idx; - EndianOrder = (b[0] ? 1 : 0); - - if (!(fpGif = fopen(GIFName, "wb"))) { - printf("Error opening gif file for output. Aborting.\n"); - goto out; - } - - Background = 0; - { - hsize_t width, height, planes; - hid_t fid; - char interlace[20]; - hssize_t npals; - hsize_t pal_dims[2]; - unsigned char *pal; - - if ((fid = H5Fopen(HDFName, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) { - fprintf(stderr, "Unable to open HDF file for input. Aborting.\n"); - goto out; - } - - /* get image's information */ - if (H5IMget_image_info(fid, image_name, &width, &height, &planes, interlace, &npals) < 0) { - fprintf(stderr, "Unable to get information of the image. Aborting.\n"); - goto out; - } - - if (width > IMAGE_WIDTH_MAX || height > IMAGE_HEIGHT_MAX) { - fprintf(stderr, "HDF5 image is too large. Limit is %d by %d.\n", IMAGE_WIDTH_MAX, - IMAGE_HEIGHT_MAX); - goto out; - } - - /* tool can handle single plane images only. */ - if (planes > 1) { - fprintf(stderr, "Cannot handle multiple planes image\n"); - goto out; - } - - Image = (GIFBYTE *)malloc((size_t)width * (size_t)height); - - if (H5IMread_image(fid, image_name, Image) < 0) { - fprintf(stderr, "Unable to read the image. Aborting.\n"); - goto out; - } - - if (npals) { - if (H5IMget_palette_info(fid, image_name, 0, pal_dims) < 0) { - fprintf(stderr, "Unable to get information of the palette. Aborting.\n"); - goto out; - } - - pal = (GIFBYTE *)malloc((size_t)pal_dims[0] * (size_t)pal_dims[1]); - - if (H5IMget_palette(fid, image_name, 0, pal) < 0) - goto out; - - numcols = (int)pal_dims[0]; - - for (i = 0, j = 0; i < numcols; j += 3, i++) { - GlobalPalette[i][0] = pal[j]; - GlobalPalette[i][1] = pal[j + 1]; - GlobalPalette[i][2] = pal[j + 2]; - } - - free(pal); - } - - H5Fclose(fid); - - RWidth = (int)width; - RHeight = (int)height; - - /* - * If the first image does not have a palette, I make my own global - * color table Obviously this is not the best thing to do, better - * steps would be: - * - * 1. Check for either a global palette or a global attribute called - * palette - * 2. Check for palettes in any of the other images. - */ - if (!npals) { - numcols = 256; - for (i = 0; i < numcols; i++) { - Red[i] = (GIFBYTE)(255 - i); - Green[i] = (GIFBYTE)(255 - i); - Blue[i] = (GIFBYTE)(255 - i); - } - } - else { - for (i = 0; i < numcols; i++) { - Red[i] = GlobalPalette[i][0]; - Green[i] = GlobalPalette[i][1]; - Blue[i] = GlobalPalette[i][2]; - } - } - - for (i = 0; i < numcols; i++) { - pc2nc[i] = r1[i] = g1[i] = b1[i] = 0; - } - - /* compute number of unique colors */ - nc = 0; - - for (i = 0; i < numcols; i++) { - /* see if color #i is already used */ - for (j = 0; j < i; j++) { - if (Red[i] == Red[j] && Green[i] == Green[j] && Blue[i] == Blue[j]) - break; - } - - if (j == i) { - /* wasn't found */ - pc2nc[i] = (GIFBYTE)nc; - r1[nc] = Red[i]; - g1[nc] = Green[i]; - b1[nc] = Blue[i]; - nc++; - } - else { - pc2nc[i] = pc2nc[j]; - } - } - - /* figure out 'BitsPerPixel' */ - for (i = 1; i < 8; i++) { - if ((1 << i) >= nc) - break; - } - - BitsPerPixel = i; - ColorMapSize = 1 << BitsPerPixel; - - if (BitsPerPixel <= 1) - InitCodeSize = 2; - else - InitCodeSize = BitsPerPixel; - - if (!fpGif) { - fprintf(stderr, "WriteGIF: file not open for writing\n"); - goto out; - } - - fwrite("GIF87a", sizeof(char), 6, fpGif); /* the GIF magic number */ - - putword(RWidth, fpGif); /* screen descriptor */ - putword(RHeight, fpGif); - - i = 0x00; /* No, there is no color map */ - i |= (8 - 1) << 4; /* OR in the color resolution (hardwired 8) */ - i |= (BitsPerPixel - 1); /* OR in the # of bits per pixel */ - fputc(i, fpGif); - - fputc(Background, fpGif); /* background color */ - fputc(0, fpGif); /* future expansion byte */ - - /* - * Put Image Descriptor - * Hardwiring Left Offset and Top Offset to 0x00 - */ - fputc(0x2c, fpGif); - putword(0x00, fpGif); - putword(0x00, fpGif); - putword(RWidth, fpGif); - putword(RHeight, fpGif); - - /* since we always have a local color palette ... */ - fputc((0x80 | (BitsPerPixel - 1)), fpGif); - - for (i = 0; i < ColorMapSize; i++) { - /* write out Global colormap */ - fputc(r1[i], fpGif); - fputc(g1[i], fpGif); - fputc(b1[i], fpGif); - } - - fputc(InitCodeSize, fpGif); - - i = hdfWriteGIF(fpGif, Image, 0, RHeight, RWidth, r1, g1, b1, pc2nc, 256, 8, BitsPerPixel); - fputc(0x00, fpGif); - free(Image); - } - - if (fputc(';', fpGif) == EOF) { - /* Write GIF file terminator */ - fprintf(stderr, "Error!"); - goto out; - } - - if (fpGif != NULL) - fclose(fpGif); - if (image_name != NULL) - free(image_name); - - leave(h5tools_getstatus()); - -out: - - if (fpGif != NULL) - fclose(fpGif); - if (image_name != NULL) - free(image_name); - - h5tools_setstatus(EXIT_FAILURE); - leave(h5tools_getstatus()); -} diff --git a/hl/tools/gif2h5/hdfgifwr.c b/hl/tools/gif2h5/hdfgifwr.c deleted file mode 100644 index 95f75d5d85e..00000000000 --- a/hl/tools/gif2h5/hdfgifwr.c +++ /dev/null @@ -1,463 +0,0 @@ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * Copyright by The HDF Group. * - * All rights reserved. * - * * - * This file is part of HDF5. The full HDF5 copyright notice, including * - * terms governing use, modification, and redistribution, is contained in * - * the COPYING file, which can be found at the root of the source code * - * distribution tree, or in https://www.hdfgroup.org/licenses. * - * If you do not have access to either file, you may request a copy from * - * help@hdfgroup.org. * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - -/* - * hdfgifwr.c - handles writing of GIF files. - * - * Contains: - * hdfWriteGIF(fp, pic, ptype, w, h, rmap, gmap, bmap, numcols, colorstyle, - * comment) - * - * Note: slightly brain-damaged, in that it'll only write non-interlaced - * GIF files (in the interests of speed, or something) - */ - -/***************************************************************** - * Portions of this code Copyright (C) 1989 by Michael Mauldin. - * Permission is granted to use this file in whole or in - * part for any purpose, educational, recreational or commercial, - * provided that this copyright notice is retained unchanged. - * This software is available to all free of charge by anonymous - * FTP and in the UUNET archives. - * - * - * Authors: Michael Mauldin (mlm@cs.cmu.edu) - * David Rowley (mgardi@watdcsu.waterloo.edu) - * - * Based on: compress.c - File compression ala IEEE Computer, June 1984. - * - * Spencer W. Thomas (decvax!harpo!utah-cs!utah-gr!thomas) - * Jim McKie (decvax!mcvax!jim) - * Steve Davies (decvax!vax135!petsd!peora!srd) - * Ken Turkowski (decvax!decwrl!turtlevax!ken) - * James A. Woods (decvax!ihnp4!ames!jaw) - * Joe Orost (decvax!vax135!petsd!joe) - *****************************************************************/ - -#include -#include -#include - -#include "gif.h" - -typedef GIFBYTE byte; -typedef long int count_int; - -#ifdef __STDC__ -static void compress(int, FILE *, byte *, int); -static void output(int); -static void cl_block(void); -static void cl_hash(count_int); -static void char_init(void); -static void char_out(int); -static void flush_char(void); -#else -static void compress(), output(), cl_block(), cl_hash(); -static void char_init(), char_out(), flush_char(); -#endif /* __STDC__ */ - -static byte pc2nc[256]; - -/***********************************************************************/ -static unsigned long cur_accum = 0; -static int cur_bits = 0; - -#define MAXCODE(n_bits) ((1 << (n_bits)) - 1) -#define XV_BITS 12 /* BITS was already defined on some systems */ -#define HSIZE 5003 /* 80% occupancy */ - -typedef unsigned char char_type; - -static int n_bits; /* number of bits/code */ -static int maxbits = XV_BITS; /* user settable max # bits/code */ -static int maxcode; /* maximum code, given n_bits */ -static int maxmaxcode = 1 << XV_BITS; /* NEVER generate this */ - -static count_int *htab; -static unsigned short *codetab; - -#define HashTabOf(i) htab[i] -#define CodeTabOf(i) codetab[i] - -static int hsize = HSIZE; /* for dynamic table sizing */ - -/* - * To save much memory, we overlay the table used by compress() with those - * used by decompress(). The tab_prefix table is the same size and type as - * the codetab. The tab_suffix table needs 2**BITS characters. We get this - * from the beginning of htab. The output stack uses the rest of htab, and - * contains characters. There is plenty of room for any possible stack (stack - * used to be 8000 characters). - */ - -static int free_ent = 0; /* first unused entry */ - -/* - * block compression parameters -- after all codes are used up, - * and compression rate changes, start over. - */ -static int clear_flg = 0; - -static long int in_count = 1; /* length of input */ -static long int out_count = 0; /* # of codes output (for debugging) */ - -/* - * compress stdin to stdout - * - * Algorithm: use open addressing double hashing (no chaining) on the prefix - * code / next character combination. We do a variant of Knuth's algorithm D - * (vol. 3, sec. 6.4) along with G. Knott's relatively-prime secondary probe. - * Here, the modular division first probe is gives way to a faster - * exclusive-or manipulation. Also do block compression with an adaptive - * reset, whereby the code table is cleared when the compression ratio - * decreases, but after the table fills. The variable-length output codes are - * re-sized at this point, and a special CLEAR code is generated for the - * decompressor. Late addition: construct the table according to file size - * for noticeable speed improvement on small files. Please direct questions - * about this implementation to ames!jaw. - */ - -static int g_init_bits; -static FILE *g_outfile; - -static int ClearCode; -static int EOFCode; - -/*************************************************************/ -int -hdfWriteGIF(FILE *fp, byte *pic, int ptype, int w, int h, const byte *rmap, const byte *gmap, - const byte *bmap, const byte *pc2ncmap, int numcols, int colorstyle, int BitsPerPixel) -{ - int InitCodeSize; - int i; - byte *pic8 = pic; - - if (!(htab = calloc(HSIZE, sizeof(count_int)))) { - fprintf(stderr, "Out of memory"); - return 1; - } - if (!(codetab = calloc(HSIZE, sizeof(unsigned short)))) { - fprintf(stderr, "Out of memory"); - return 1; - } - - /* Shut compiler up... */ - (void)ptype; - (void)rmap; - (void)gmap; - (void)bmap; - (void)numcols; - (void)colorstyle; - - for (i = 0; i < 256; i++) { - pc2nc[i] = pc2ncmap[i]; - } - - if (BitsPerPixel <= 1) - InitCodeSize = 2; - else - InitCodeSize = BitsPerPixel; - - if (!fp) { - fprintf(stderr, "WriteGIF: file not open for writing\n"); - return 1; - } - - compress(InitCodeSize + 1, fp, pic8, w * h); - - free(htab); - free(codetab); - - if (ferror(fp)) - return -1; - - return 0; -} - -/********************************************************/ -static void -compress(int init_bits, FILE *outfile, byte *data, int len) -{ - long fcode; - int i = 0; - int c; - int ent; - int disp; - int hsize_reg; - int hshift; - - /* - * Set up the globals: g_init_bits - initial number of bits g_outfile - - * pointer to output file - */ - g_init_bits = init_bits; - g_outfile = outfile; - - /* initialize 'compress' globals */ - maxbits = XV_BITS; - maxmaxcode = 1 << XV_BITS; - hsize = HSIZE; - free_ent = 0; - clear_flg = 0; - in_count = 1; - out_count = 0; - cur_accum = 0; - cur_bits = 0; - - /* Set up the necessary values */ - out_count = 0; - clear_flg = 0; - in_count = 1; - maxcode = MAXCODE(n_bits = g_init_bits); - - ClearCode = (1 << (init_bits - 1)); - EOFCode = ClearCode + 1; - free_ent = ClearCode + 2; - - char_init(); - ent = pc2nc[*data++]; - len--; - - hshift = 0; - for (fcode = (long)hsize; fcode < 65536L; fcode *= 2L) - hshift++; - - hshift = 8 - hshift; /* set hash code range bound */ - - hsize_reg = hsize; - cl_hash((count_int)hsize_reg); /* clear hash table */ - - output(ClearCode); - - while (len) { - c = pc2nc[*data++]; - len--; - in_count++; - - fcode = (long)(((long)c << maxbits) + ent); - i = (((int)c << hshift) ^ ent); /* xor hashing */ - - if (HashTabOf(i) == fcode) { - ent = CodeTabOf(i); - continue; - } - else if ((long)HashTabOf(i) < 0) { - /* empty slot */ - goto nomatch; - } - - disp = hsize_reg - i; /* secondary hash (after G. Knott) */ - - if (i == 0) - disp = 1; - -probe: - if ((i -= disp) < 0) - i += hsize_reg; - - if (HashTabOf(i) == fcode) { - ent = CodeTabOf(i); - continue; - } - - if ((long)HashTabOf(i) >= 0) - goto probe; - -nomatch: - output(ent); - out_count++; - ent = c; - - if (free_ent < maxmaxcode) { - CodeTabOf(i) = (unsigned short)free_ent++; /* code -> hashtable */ - HashTabOf(i) = fcode; - } - else { - cl_block(); - } - } - - /* Put out the final code */ - output(ent); - out_count++; - output(EOFCode); -} - -/***************************************************************** - * TAG( output ) - * - * Output the given code. - * Inputs: - * code: A n_bits-bit integer. If == -1, then EOF. This assumes - * that n_bits =< (long)wordsize - 1. - * Outputs: - * Outputs code to the file. - * Assumptions: - * Chars are 8 bits long. - * Algorithm: - * Maintain a BITS character long buffer (so that 8 codes will - * fit in it exactly). Use the VAX insv instruction to insert each - * code in turn. When the buffer fills up empty it and start over. - */ - -static unsigned long masks[] = {0x0000, 0x0001, 0x0003, 0x0007, 0x000F, 0x001F, 0x003F, 0x007F, 0x00FF, - 0x01FF, 0x03FF, 0x07FF, 0x0FFF, 0x1FFF, 0x3FFF, 0x7FFF, 0xFFFF}; - -static void -output(int code) -{ - cur_accum &= masks[cur_bits]; - - if (cur_bits > 0) - cur_accum |= (unsigned long)((long)code << cur_bits); - else - cur_accum = (unsigned long)code; - - cur_bits += n_bits; - - while (cur_bits >= 8) { - char_out((int)((unsigned int)cur_accum & 0xff)); - cur_accum >>= 8; - cur_bits -= 8; - } - - /* - * If the next entry is going to be too big for the code size, then - * increase it, if possible. - */ - if (free_ent > maxcode || clear_flg) { - if (clear_flg) { - maxcode = MAXCODE(n_bits = g_init_bits); - clear_flg = 0; - } - else { - n_bits++; - - if (n_bits == maxbits) - maxcode = maxmaxcode; - else - maxcode = MAXCODE(n_bits); - } - } - - if (code == EOFCode) { - /* At EOF, write the rest of the buffer */ - while (cur_bits > 0) { - char_out((int)((unsigned int)cur_accum & 0xff)); - cur_accum >>= 8; - cur_bits -= 8; - } - - flush_char(); - fflush(g_outfile); - -#ifdef FOO - if (ferror(g_outfile)) - FatalError("unable to write GIF file"); -#endif - } -} - -/********************************/ -static void -cl_block(void) /* table clear for block compress */ -{ - /* Clear out the hash table */ - cl_hash((count_int)hsize); - free_ent = ClearCode + 2; - clear_flg = 1; - output(ClearCode); -} - -/********************************/ -static void -cl_hash(count_int hashsize) /* reset code table */ -{ - count_int *htab_p = htab + hashsize; - long i, m1 = -1; - - i = hashsize - 16; - - do { /* might use Sys V memset(3) here */ - *(htab_p - 16) = m1; - *(htab_p - 15) = m1; - *(htab_p - 14) = m1; - *(htab_p - 13) = m1; - *(htab_p - 12) = m1; - *(htab_p - 11) = m1; - *(htab_p - 10) = m1; - *(htab_p - 9) = m1; - *(htab_p - 8) = m1; - *(htab_p - 7) = m1; - *(htab_p - 6) = m1; - *(htab_p - 5) = m1; - *(htab_p - 4) = m1; - *(htab_p - 3) = m1; - *(htab_p - 2) = m1; - *(htab_p - 1) = m1; - htab_p -= 16; - } while ((i -= 16) >= 0); - - for (i += 16; i > 0; i--) - *--htab_p = m1; -} - -/****************************************************************************** - * - * GIF Specific routines - * - ******************************************************************************/ - -/* - * Number of characters so far in this 'packet' - */ -static int a_count; - -/* - * Set up the 'byte output' routine - */ -static void -char_init(void) -{ - a_count = 0; -} - -/* - * Define the storage for the packet accumulator - */ -static char accum[256]; - -/* - * Add a character to the end of the current packet, and if it is 254 - * characters, flush the packet to disk. - */ -static void -char_out(int c) -{ - accum[a_count++] = (char)c; - - if (a_count >= 254) - flush_char(); -} - -/* - * Flush the packet to disk, and reset the accumulator - */ -static void -flush_char(void) -{ - if (a_count > 0) { - fputc(a_count, g_outfile); - fwrite(accum, (size_t)1, (size_t)a_count, g_outfile); - a_count = 0; - } -} diff --git a/hl/tools/gif2h5/testfiles/README b/hl/tools/gif2h5/testfiles/README deleted file mode 100644 index a428d479e66..00000000000 --- a/hl/tools/gif2h5/testfiles/README +++ /dev/null @@ -1,6 +0,0 @@ -ex_image2.h5 - Generated by hl/examples/ex_image2.c -5giftst.h5: - Generated by ../h52gifgentst.c -image1.gif: - To be determined. diff --git a/hl/tools/gif2h5/testfiles/ex_image2.h5 b/hl/tools/gif2h5/testfiles/ex_image2.h5 deleted file mode 100644 index a36df1b480f..00000000000 Binary files a/hl/tools/gif2h5/testfiles/ex_image2.h5 and /dev/null differ diff --git a/hl/tools/gif2h5/testfiles/h52giftst.h5 b/hl/tools/gif2h5/testfiles/h52giftst.h5 deleted file mode 100644 index a827b3b5057..00000000000 Binary files a/hl/tools/gif2h5/testfiles/h52giftst.h5 and /dev/null differ diff --git a/hl/tools/gif2h5/testfiles/image1.gif b/hl/tools/gif2h5/testfiles/image1.gif deleted file mode 100644 index b90b23aa4c4..00000000000 Binary files a/hl/tools/gif2h5/testfiles/image1.gif and /dev/null differ diff --git a/hl/tools/gif2h5/writehdf.c b/hl/tools/gif2h5/writehdf.c deleted file mode 100644 index 8f0cc0d6182..00000000000 --- a/hl/tools/gif2h5/writehdf.c +++ /dev/null @@ -1,115 +0,0 @@ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * Copyright by The HDF Group. * - * All rights reserved. * - * * - * This file is part of HDF5. The full HDF5 copyright notice, including * - * terms governing use, modification, and redistribution, is contained in * - * the COPYING file, which can be found at the root of the source code * - * distribution tree, or in https://www.hdfgroup.org/licenses. * - * If you do not have access to either file, you may request a copy from * - * help@hdfgroup.org. * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#include -#include -#include - -#include "gif.h" -#include "H5IMpublic.h" - -#define PAL_NAME "global" - -/*------------------------------------------------------------------------- - * Function: WriteHDF - * - * Purpose: Write the GIF image with the HDF5 Image API - * - *------------------------------------------------------------------------- - */ - -int -WriteHDF(GIFTOMEM GifMemoryStruct, char *HDFName) -{ - GIFHEAD gifHead; /* GIF Header structure */ - GIFIMAGEDESC *gifImageDesc; /* Logical Image Descriptor struct */ - int has_pal = 0; - - long ImageCount; /* number of images */ -#ifdef UNUSED - long CommentCount, /* number of comments */ - ApplicationCount, /* number of application extensions */ - PlainTextCount; /* number of plain text extensions */ -#endif /* UNUSED */ - - char ImageName[256]; /* Image name for the Image */ - - /* H5 variables */ - hid_t file_id; /* H5 file id */ - - /* temp counter */ - int i; - - /* get the GIFMem stuff */ - gifHead = *(GifMemoryStruct.GifHeader); - - /* get some data from gifHead */ - ImageCount = gifHead.ImageCount; -#ifdef UNUSED - CommentCount = (GIFWORD)gifHead.CommentCount; - ApplicationCount = (GIFWORD)gifHead.ApplicationCount; - PlainTextCount = (GIFWORD)gifHead.PlainTextCount; -#endif /* UNUSED */ - - if ((file_id = H5Fcreate(HDFName, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) { - /* error occurred opening the HDF File for write */ - fprintf(stderr, "HDF file could not be opened for writing\n"); - fprintf(stderr, - "NOTE: GIF file must be present in the same directory as the binary on UNIX systems.\n"); - exit(1); - } - - /* first create the global palette if there is one */ - if (gifHead.PackedField & 0x80) { /* global palette exists */ - hsize_t dims[2]; /* specify the dimensions of the palette */ - - /* size of the palette is tablesize (rows) X 3 (columns) */ - dims[0] = gifHead.TableSize; - dims[1] = 3; - - /* make a palette */ - if (H5IMmake_palette(file_id, PAL_NAME, dims, (unsigned char *)gifHead.HDFPalette) < 0) - return -1; - - has_pal = 1; - } - - for (i = 0; i < ImageCount; i++) { - hsize_t dims[2]; /* dimensions for the dataset */ - /* get the gifImageDesc */ - gifImageDesc = GifMemoryStruct.GifImageDesc[i]; - - /* set the dimensions */ - dims[0] = gifImageDesc->ImageHeight; - dims[1] = gifImageDesc->ImageWidth; - - /* create the image name */ - snprintf(ImageName, sizeof(ImageName), "Image%d", i); - - /* write image */ - if (H5IMmake_image_8bit(file_id, ImageName, dims[1], dims[0], (gifImageDesc->Image)) < 0) - return -1; - - /* attach the palette to the image dataset */ - if (has_pal) { - if (H5IMlink_palette(file_id, ImageName, PAL_NAME) < 0) - return -1; - } - } - - /* close the H5 file */ - if (H5Fclose(file_id) < 0) { - fprintf(stderr, "Could not close HDF5 file. Aborting...\n"); - return -1; - } - - return 0; -} diff --git a/release_docs/INSTALL_Autotools.txt b/release_docs/INSTALL_Autotools.txt index 325090aadd4..5a5f1fec31e 100644 --- a/release_docs/INSTALL_Autotools.txt +++ b/release_docs/INSTALL_Autotools.txt @@ -484,8 +484,6 @@ III. Full installation instructions for source distributions ./tools/misc/h5debug (low-level file debugging) ./tools/h5import/h5import (imports data to HDF5 file) ./tools/h5diff/h5diff (compares two HDF5 files) - ./tools/gifconv/h52gif (HDF5 to GIF converter) - ./tools/gifconv/gif2h5 (GIF to HDF5 converter) ======================================================================== diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 7f4571ef0df..5fabb8dafbe 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -116,8 +116,19 @@ New Features Tools: ------ - - + - Remove the high-level GIF tools + + The high-level GIF tools, h52gif and gif2h5, have unfixed CVE issues + (with no proof-of-concept files). They are not critical tools, are not + well maintained, and are an odd fit for building with the library. + Because of this, they have been removed. We may move them to a separate + repository in the future. + + This also removes the following configure options: + + Autotools: --(dis|en)able-hlgiftools + CMake: HDF5_BUILD_HL_GIF_TOOLS High-Level APIs: ---------------- diff --git a/src/H5build_settings.autotools.c.in b/src/H5build_settings.autotools.c.in index 67bd023b961..70eb34b8123 100644 --- a/src/H5build_settings.autotools.c.in +++ b/src/H5build_settings.autotools.c.in @@ -93,7 +93,6 @@ const char H5build_settings[]= "Dimension scales w/ new references: @DIMENSION_SCALES_WITH_NEW_REF@\n" " Build HDF5 Tests: @HDF5_TESTS@\n" " Build HDF5 Tools: @HDF5_TOOLS@\n" - " Build GIF Tools: @HDF5_HL_GIF_TOOLS@\n" " Threads: @THREADS@\n" " Threadsafety: @THREADSAFE@\n" " Default API mapping: @DEFAULT_API_VERSION@\n" diff --git a/src/libhdf5.settings.autotools.in b/src/libhdf5.settings.autotools.in index f04cca78e23..e7900a19dfc 100644 --- a/src/libhdf5.settings.autotools.in +++ b/src/libhdf5.settings.autotools.in @@ -75,7 +75,6 @@ Features: Dimension scales w/ new references: @DIMENSION_SCALES_WITH_NEW_REF@ Build HDF5 Tests: @HDF5_TESTS@ Build HDF5 Tools: @HDF5_TOOLS@ - Build GIF Tools: @HDF5_HL_GIF_TOOLS@ Threads: @THREADS@ Threadsafety: @THREADSAFE@ Default API mapping: @DEFAULT_API_VERSION@