From 4380782965f15f8b6e5c04022dce23779b83a022 Mon Sep 17 00:00:00 2001 From: Michael Jennings Date: Wed, 29 May 2002 13:23:25 +0000 Subject: [PATCH] Wed May 29 09:22:42 2002 Michael Jennings (mej) Merged changes from SPLIT into the main trunk and deleted SPLIT. SVN revision: 6288 --- autogen.sh | 16 ++-- configure.ac | 2 +- configure.in | 2 +- imlib2.spec | 16 +++- loaders/Makefile.am | 26 +++---- loaders/loader_gzbz2.c | 170 ++++++++++++++++++++--------------------- 6 files changed, 124 insertions(+), 108 deletions(-) diff --git a/autogen.sh b/autogen.sh index 86a2996..afe7929 100755 --- a/autogen.sh +++ b/autogen.sh @@ -24,12 +24,18 @@ THEDIR="`pwd`" cd "$srcdir" DIE=0 +SUBDIRS="libltdl ." + set -x -aclocal || abort "aclocal" -libtoolize --ltdl --force --copy || abort "libtoolize" -autoheader || abort "autoheader" -automake --foreign --add-missing || abort "automake" -autoconf || abort "autoconf" + +for EACHDIR in $SUBDIRS ; do + cd $THEDIR/$EACHDIR + aclocal || abort "aclocal" + libtoolize --ltdl --force --copy || abort "libtoolize" + autoheader || abort "autoheader" + automake --foreign --add-missing || abort "automake" + autoconf || abort "autoconf" +done if test -z "$*"; then echo "I am going to run ./configure with no arguments - if you wish " diff --git a/configure.ac b/configure.ac index 7905015..5eea844 100644 --- a/configure.ac +++ b/configure.ac @@ -3,7 +3,7 @@ dnl Process this file with autoconf to create configure. AC_INIT AC_CONFIG_SRCDIR([src/Imlib2.h]) AC_CANONICAL_TARGET([]) -AM_INIT_AUTOMAKE(imlib2, 1.0.5) +AM_INIT_AUTOMAKE(imlib2, 1.0.6) AM_CONFIG_HEADER(config.h) diff --git a/configure.in b/configure.in index 85de9ec..44b2f91 100644 --- a/configure.in +++ b/configure.in @@ -2,7 +2,7 @@ dnl Process this file with autoconf to create configure. AC_INIT(src/Imlib2.h) AC_CANONICAL_SYSTEM -AM_INIT_AUTOMAKE(imlib2, 1.0.5) +AM_INIT_AUTOMAKE(imlib2, 1.0.6) AM_CONFIG_HEADER(config.h) diff --git a/imlib2.spec b/imlib2.spec index 9958280..8a75a36 100644 --- a/imlib2.spec +++ b/imlib2.spec @@ -1,7 +1,7 @@ Summary: Powerful image loading and rendering library Name: imlib2 -Version: 1.0.5 -Release: 1 +Version: 1.0.6 +Release: 3 Copyright: BSD Group: System Environment/Libraries Source: ftp://ftp.enlightenment.org/pub/enlightenment/e17/libs/%{name}-%{version}.tar.gz @@ -12,6 +12,9 @@ BuildRequires: libjpeg-devel BuildRequires: libpng-devel BuildRequires: XFree86-devel BuildRequires: freetype-devel +Requires: %{name}-loader_jpeg = %{version} +Requires: %{name}-loader_png = %{version} +Requires: %{name}-loader_argb = %{version} %description Imlib2 is an advanced replacement library for libraries like libXpm that @@ -91,6 +94,12 @@ Group: System Environment/Libraries %description loader_xpm XPM image loader/saver for Imlib2 +%package loader_gzbz2 +Summary: Imlib2 .gz/.bz2 loader +Group: System Environment/Libraries +%description loader_gzbz2 +Gzip/Bzip2 compressed image loader/saver for Imlib2 + %prep rm -rf $RPM_BUILD_ROOT @@ -175,6 +184,9 @@ rm -rf $RPM_BUILD_ROOT %files loader_xpm %attr(755,root,root) %{_libdir}/loaders/image/xpm.* +%files loader_gzbz2 +%attr(755,root,root) %{_libdir}/loaders/image/gzbz2.* + %changelog * Mon Jan 8 2001 The Rasterman - Fix Requires & BuildRequires for freetype. diff --git a/loaders/Makefile.am b/loaders/Makefile.am index a7656c8..3accc21 100644 --- a/loaders/Makefile.am +++ b/loaders/Makefile.am @@ -31,44 +31,44 @@ $(JPEG_L) \ $(PNG_L) \ $(TIFF_L) \ $(GIF_L) \ -pnm.la argb.la bmp.la xpm.la tga.la #xcf.la +pnm.la argb.la bmp.la xpm.la tga.la gzbz2.la jpeg_la_SOURCES = loader_jpeg.c jpeg_la_LDFLAGS = -no-undefined -module -avoid-version -jpeg_la_LIBADD = @JPEGLIBS@ -L$(top_builddir)/src -lImlib2 +jpeg_la_LIBADD = @JPEGLIBS@ -L$(top_builddir)/src png_la_SOURCES = loader_png.c png_la_LDFLAGS = -no-undefined -module -avoid-version -png_la_LIBADD = @PNGLIBS@ -L$(top_builddir)/src -lImlib2 +png_la_LIBADD = @PNGLIBS@ -L$(top_builddir)/src tiff_la_SOURCES = loader_tiff.c tiff_la_LDFLAGS = -no-undefined -module -avoid-version -tiff_la_LIBADD = @TIFFLIBS@ -L$(top_builddir)/src -lImlib2 +tiff_la_LIBADD = @TIFFLIBS@ -L$(top_builddir)/src gif_la_SOURCES = loader_gif.c gif_la_LDFLAGS = -no-undefined -module -avoid-version -gif_la_LIBADD = @GIFLIBS@ -L$(top_builddir)/src -lImlib2 +gif_la_LIBADD = @GIFLIBS@ -L$(top_builddir)/src pnm_la_SOURCES = loader_pnm.c pnm_la_LDFLAGS = -no-undefined -module -avoid-version -pnm_la_LIBADD = -L$(top_builddir)/src -lImlib2 +pnm_la_LIBADD = -L$(top_builddir)/src argb_la_SOURCES = loader_argb.c argb_la_LDFLAGS = -no-undefined -module -avoid-version -argb_la_LIBADD = -L$(top_builddir)/src -lImlib2 +argb_la_LIBADD = -L$(top_builddir)/src bmp_la_SOURCES = loader_bmp.c bmp_la_LDFLAGS = -no-undefined -module -avoid-version -bmp_la_LIBADD = -L$(top_builddir)/src -lImlib2 +bmp_la_LIBADD = -L$(top_builddir)/src xpm_la_SOURCES = loader_xpm.c xpm_la_LDFLAGS = -no-undefined -module -avoid-version -xpm_la_LIBADD = -L$(top_builddir)/src -lImlib2 +xpm_la_LIBADD = -L$(top_builddir)/src tga_la_SOURCES = loader_tga.c tga_la_LDFLAGS = -no-undefined -module -avoid-version -tga_la_LIBADD = -L$(top_builddir)/src -lImlib2 +tga_la_LIBADD = -L$(top_builddir)/src -#xcf_la_SOURCES = loader_xcf.c loader_xcf_pixelfuncs.c -#xcf_la_LDFLAGS = -no-undefined -module -avoid-version -#xcf_la_LIBADD = +gzbz2_la_SOURCES = loader_gzbz2.c +gzbz2_la_LDFLAGS = -no-undefined -module -avoid-version +gzbz2_la_LIBADD = -L$(top_builddir)/src diff --git a/loaders/loader_gzbz2.c b/loaders/loader_gzbz2.c index fe382a1..a3c1a5c 100644 --- a/loaders/loader_gzbz2.c +++ b/loaders/loader_gzbz2.c @@ -1,13 +1,13 @@ /* Team members of IMLIB2 plz have a look at first scratch of .gz & .bz2 - loader - I need it in my common work for lots of reasons, it is more - or less UNIX ready, but I used OS/2 for testing, also I am not sure - about temp directory for example gimp loader use tempnames for some - reason (??) If you think this loader is not needed for Imlib2 feel - free to wipe it entirely. Also if it will be ok, wipe this comment off, - and add to makefiles - Stauff (pla@cland.ru) - */ - + * loader - I need it in my common work for lots of reasons, it is more + * or less UNIX ready, but I used OS/2 for testing, also I am not sure + * about temp directory for example gimp loader use tempnames for some + * reason (??) If you think this loader is not needed for Imlib2 feel + * free to wipe it entirely. Also if it will be ok, wipe this comment off, + * and add to makefiles + * Stauff (pla@cland.ru) + */ + #ifdef HAVE_CONFIG_H # include #endif @@ -22,119 +22,117 @@ #include #include "image.h" -char load (ImlibImage *im, ImlibProgressFunction progress, - char progress_granularity, char immediate_load); -char save (ImlibImage *im, ImlibProgressFunction progress, - char progress_granularity); -void formats (ImlibLoader *l); +char load(ImlibImage * im, ImlibProgressFunction progress, + char progress_granularity, char immediate_load); +char save(ImlibImage * im, ImlibProgressFunction progress, + char progress_granularity); +void formats(ImlibLoader * l); static int exists(char *file) { struct stat st; - + if (stat(file, &st) < 0) return 0; return 1; } -char * pure_filename(char *path_filename) +char * +pure_filename(char *path_filename) { - char *ptr; - - ptr = strrchr(path_filename,'/'); + char *ptr; + + ptr = strrchr(path_filename, '/'); #ifdef __EMX__ - /* Care about \\ */ + /* Care about \\ */ #endif - if (ptr) ptr++; - else ptr = path_filename; - - return ptr; + if (ptr) + ptr++; + else + ptr = path_filename; + + return ptr; } -char load (ImlibImage *im, ImlibProgressFunction progress, - char progress_granularity, char immediate_load) +char +load(ImlibImage * im, ImlibProgressFunction progress, + char progress_granularity, char immediate_load) { - char file[4096], key[4096], *ptr; - char *str_gz; - ImlibLoader *sub_loader; - + char file[4096], *ptr; + char *str_gz; + ImlibLoader *sub_loader; + char *tmpdir; + + str_gz = malloc(4096); + if (im->data) return 0; if (!im->file) return 0; strncpy(file, im->real_file, sizeof(file)); file[sizeof(file) - 1] = 0; - if (!exists(file)) + if (!exists(file)) + return 0; + ptr = strrchr(file, '.'); + if (!ptr) return 0; - ptr = strrchr(file,'.'); - if (!ptr) return 0; *ptr = 0; - if (getenv("TMPDIR")) - { - strncpy(key,getenv("TMPDIR"), sizeof(key)); - key[sizeof(key) - 1] = 0; - } - else - { _getcwd2(key, sizeof(key)); -#ifdef __EMX__ - if (key[strlen(key)-1] == '/') key[strlen(key)-1] = 0; -#endif - } - if ( (strlen(ptr+1)>=2) && (!strcmp(ptr+1,"gz")) ) - { - str_gz = (char *) malloc(20 + strlen(im->real_file) + strlen(key) + strlen(file)); - sprintf(str_gz,"gzip -d %s -c > %s/%s", im->real_file, key, pure_filename(file)); - } - else if ( (strlen(ptr+1)>=3) && (!strcmp(ptr+1,"bz2")) ) - { - str_gz = (char *) malloc(20 + strlen(im->real_file) + strlen(key) + strlen(file)); - sprintf(str_gz,"bzip2 -d %s -c > %s/%s", im->real_file, key, pure_filename(file)); - } - else - return 0; /* Eeek why we are here? */ + if (!(tmpdir = getenv("TMPDIR"))) + tmpdir = "/tmp"; - if (system(str_gz)<0) return 0; + if ((strlen(ptr + 1) >= 2) && (!strcmp(ptr + 1, "gz"))) + { + sprintf(str_gz, "gzip -d %s -c > %s/%s", im->real_file, tmpdir, + pure_filename(file)); + } + else if ((strlen(ptr + 1) >= 3) && (!strcmp(ptr + 1, "bz2"))) + { + sprintf(str_gz, "bzip2 -d %s -c > %s/%s", im->real_file, tmpdir, + pure_filename(file)); + } + else + return 0; /* Eeek why we are here? */ + if (system(str_gz) < 0) + return 0; free(im->real_file); - sprintf(str_gz,"%s/%s", key, pure_filename(file)); + sprintf(str_gz, "%s/%s", tmpdir, pure_filename(file)); im->real_file = strdup(str_gz); free(str_gz); im->format = strdup(++ptr); sub_loader = __imlib_FindBestLoaderForFile(im->real_file); if (sub_loader) - sub_loader->load(im, progress, progress_granularity,1); - else - { unlink(im->real_file); - return 0; + sub_loader->load(im, progress, progress_granularity, 1); + else + { + unlink(im->real_file); + return 0; } - unlink(im->real_file); + unlink(im->real_file); free(im->real_file); - *--ptr = '.'; - im->real_file=strdup(real_file); + *--ptr = '.'; + im->real_file = strdup(file); return 1; } -char save (ImlibImage *im, ImlibProgressFunction progress, - char progress_granularity) +char +save(ImlibImage * im, ImlibProgressFunction progress, char progress_granularity) { - /* TODO */ - return 0; -} - - -void -formats (ImlibLoader *l) -{ - char *list_formats[] = - { "gz","bz2" }; - - { - int i; - - l->num_formats = (sizeof(list_formats) / sizeof (char *)); - l->formats = malloc(sizeof(char *) * l->num_formats); - for (i = 0; i < l->num_formats; i++) - l->formats[i] = strdup(list_formats[i]); - } + /* TODO */ + return 0; } +void +formats(ImlibLoader * l) +{ + char *list_formats[] = { "gz", "bz2" }; + + { + int i; + + l->num_formats = (sizeof(list_formats) / sizeof(char *)); + l->formats = malloc(sizeof(char *) * l->num_formats); + for (i = 0; i < l->num_formats; i++) + l->formats[i] = strdup(list_formats[i]); + } +}