forked from old/legacy-imlib2
Wed May 29 09:22:42 2002 Michael Jennings (mej)
Merged changes from SPLIT into the main trunk and deleted SPLIT. SVN revision: 6288
This commit is contained in:
parent
b374d48ccc
commit
4380782965
16
autogen.sh
16
autogen.sh
|
@ -24,12 +24,18 @@ THEDIR="`pwd`"
|
||||||
cd "$srcdir"
|
cd "$srcdir"
|
||||||
DIE=0
|
DIE=0
|
||||||
|
|
||||||
|
SUBDIRS="libltdl ."
|
||||||
|
|
||||||
set -x
|
set -x
|
||||||
aclocal || abort "aclocal"
|
|
||||||
libtoolize --ltdl --force --copy || abort "libtoolize"
|
for EACHDIR in $SUBDIRS ; do
|
||||||
autoheader || abort "autoheader"
|
cd $THEDIR/$EACHDIR
|
||||||
automake --foreign --add-missing || abort "automake"
|
aclocal || abort "aclocal"
|
||||||
autoconf || abort "autoconf"
|
libtoolize --ltdl --force --copy || abort "libtoolize"
|
||||||
|
autoheader || abort "autoheader"
|
||||||
|
automake --foreign --add-missing || abort "automake"
|
||||||
|
autoconf || abort "autoconf"
|
||||||
|
done
|
||||||
|
|
||||||
if test -z "$*"; then
|
if test -z "$*"; then
|
||||||
echo "I am going to run ./configure with no arguments - if you wish "
|
echo "I am going to run ./configure with no arguments - if you wish "
|
||||||
|
|
|
@ -3,7 +3,7 @@ dnl Process this file with autoconf to create configure.
|
||||||
AC_INIT
|
AC_INIT
|
||||||
AC_CONFIG_SRCDIR([src/Imlib2.h])
|
AC_CONFIG_SRCDIR([src/Imlib2.h])
|
||||||
AC_CANONICAL_TARGET([])
|
AC_CANONICAL_TARGET([])
|
||||||
AM_INIT_AUTOMAKE(imlib2, 1.0.5)
|
AM_INIT_AUTOMAKE(imlib2, 1.0.6)
|
||||||
|
|
||||||
AM_CONFIG_HEADER(config.h)
|
AM_CONFIG_HEADER(config.h)
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@ dnl Process this file with autoconf to create configure.
|
||||||
|
|
||||||
AC_INIT(src/Imlib2.h)
|
AC_INIT(src/Imlib2.h)
|
||||||
AC_CANONICAL_SYSTEM
|
AC_CANONICAL_SYSTEM
|
||||||
AM_INIT_AUTOMAKE(imlib2, 1.0.5)
|
AM_INIT_AUTOMAKE(imlib2, 1.0.6)
|
||||||
|
|
||||||
AM_CONFIG_HEADER(config.h)
|
AM_CONFIG_HEADER(config.h)
|
||||||
|
|
||||||
|
|
16
imlib2.spec
16
imlib2.spec
|
@ -1,7 +1,7 @@
|
||||||
Summary: Powerful image loading and rendering library
|
Summary: Powerful image loading and rendering library
|
||||||
Name: imlib2
|
Name: imlib2
|
||||||
Version: 1.0.5
|
Version: 1.0.6
|
||||||
Release: 1
|
Release: 3
|
||||||
Copyright: BSD
|
Copyright: BSD
|
||||||
Group: System Environment/Libraries
|
Group: System Environment/Libraries
|
||||||
Source: ftp://ftp.enlightenment.org/pub/enlightenment/e17/libs/%{name}-%{version}.tar.gz
|
Source: ftp://ftp.enlightenment.org/pub/enlightenment/e17/libs/%{name}-%{version}.tar.gz
|
||||||
|
@ -12,6 +12,9 @@ BuildRequires: libjpeg-devel
|
||||||
BuildRequires: libpng-devel
|
BuildRequires: libpng-devel
|
||||||
BuildRequires: XFree86-devel
|
BuildRequires: XFree86-devel
|
||||||
BuildRequires: freetype-devel
|
BuildRequires: freetype-devel
|
||||||
|
Requires: %{name}-loader_jpeg = %{version}
|
||||||
|
Requires: %{name}-loader_png = %{version}
|
||||||
|
Requires: %{name}-loader_argb = %{version}
|
||||||
|
|
||||||
%description
|
%description
|
||||||
Imlib2 is an advanced replacement library for libraries like libXpm that
|
Imlib2 is an advanced replacement library for libraries like libXpm that
|
||||||
|
@ -91,6 +94,12 @@ Group: System Environment/Libraries
|
||||||
%description loader_xpm
|
%description loader_xpm
|
||||||
XPM image loader/saver for Imlib2
|
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
|
%prep
|
||||||
rm -rf $RPM_BUILD_ROOT
|
rm -rf $RPM_BUILD_ROOT
|
||||||
|
|
||||||
|
@ -175,6 +184,9 @@ rm -rf $RPM_BUILD_ROOT
|
||||||
%files loader_xpm
|
%files loader_xpm
|
||||||
%attr(755,root,root) %{_libdir}/loaders/image/xpm.*
|
%attr(755,root,root) %{_libdir}/loaders/image/xpm.*
|
||||||
|
|
||||||
|
%files loader_gzbz2
|
||||||
|
%attr(755,root,root) %{_libdir}/loaders/image/gzbz2.*
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
* Mon Jan 8 2001 The Rasterman <raster@rasterman.com>
|
* Mon Jan 8 2001 The Rasterman <raster@rasterman.com>
|
||||||
- Fix Requires & BuildRequires for freetype.
|
- Fix Requires & BuildRequires for freetype.
|
||||||
|
|
|
@ -31,44 +31,44 @@ $(JPEG_L) \
|
||||||
$(PNG_L) \
|
$(PNG_L) \
|
||||||
$(TIFF_L) \
|
$(TIFF_L) \
|
||||||
$(GIF_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_SOURCES = loader_jpeg.c
|
||||||
jpeg_la_LDFLAGS = -no-undefined -module -avoid-version
|
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_SOURCES = loader_png.c
|
||||||
png_la_LDFLAGS = -no-undefined -module -avoid-version
|
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_SOURCES = loader_tiff.c
|
||||||
tiff_la_LDFLAGS = -no-undefined -module -avoid-version
|
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_SOURCES = loader_gif.c
|
||||||
gif_la_LDFLAGS = -no-undefined -module -avoid-version
|
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_SOURCES = loader_pnm.c
|
||||||
pnm_la_LDFLAGS = -no-undefined -module -avoid-version
|
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_SOURCES = loader_argb.c
|
||||||
argb_la_LDFLAGS = -no-undefined -module -avoid-version
|
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_SOURCES = loader_bmp.c
|
||||||
bmp_la_LDFLAGS = -no-undefined -module -avoid-version
|
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_SOURCES = loader_xpm.c
|
||||||
xpm_la_LDFLAGS = -no-undefined -module -avoid-version
|
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_SOURCES = loader_tga.c
|
||||||
tga_la_LDFLAGS = -no-undefined -module -avoid-version
|
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
|
gzbz2_la_SOURCES = loader_gzbz2.c
|
||||||
#xcf_la_LDFLAGS = -no-undefined -module -avoid-version
|
gzbz2_la_LDFLAGS = -no-undefined -module -avoid-version
|
||||||
#xcf_la_LIBADD =
|
gzbz2_la_LIBADD = -L$(top_builddir)/src
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
/* Team members of IMLIB2 plz have a look at first scratch of .gz & .bz2
|
/* 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
|
* 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
|
* 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
|
* about temp directory for example gimp loader use tempnames for some
|
||||||
reason (??) If you think this loader is not needed for Imlib2 feel
|
* 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,
|
* free to wipe it entirely. Also if it will be ok, wipe this comment off,
|
||||||
and add to makefiles
|
* and add to makefiles
|
||||||
Stauff (pla@cland.ru)
|
* Stauff (pla@cland.ru)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
# include <config.h>
|
# include <config.h>
|
||||||
#endif
|
#endif
|
||||||
|
@ -22,119 +22,117 @@
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include "image.h"
|
#include "image.h"
|
||||||
|
|
||||||
char load (ImlibImage *im, ImlibProgressFunction progress,
|
char load(ImlibImage * im, ImlibProgressFunction progress,
|
||||||
char progress_granularity, char immediate_load);
|
char progress_granularity, char immediate_load);
|
||||||
char save (ImlibImage *im, ImlibProgressFunction progress,
|
char save(ImlibImage * im, ImlibProgressFunction progress,
|
||||||
char progress_granularity);
|
char progress_granularity);
|
||||||
void formats (ImlibLoader *l);
|
void formats(ImlibLoader * l);
|
||||||
|
|
||||||
static int
|
static int
|
||||||
exists(char *file)
|
exists(char *file)
|
||||||
{
|
{
|
||||||
struct stat st;
|
struct stat st;
|
||||||
|
|
||||||
if (stat(file, &st) < 0)
|
if (stat(file, &st) < 0)
|
||||||
return 0;
|
return 0;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
char * pure_filename(char *path_filename)
|
char *
|
||||||
|
pure_filename(char *path_filename)
|
||||||
{
|
{
|
||||||
char *ptr;
|
char *ptr;
|
||||||
|
|
||||||
ptr = strrchr(path_filename,'/');
|
ptr = strrchr(path_filename, '/');
|
||||||
#ifdef __EMX__
|
#ifdef __EMX__
|
||||||
/* Care about \\ */
|
/* Care about \\ */
|
||||||
#endif
|
#endif
|
||||||
if (ptr) ptr++;
|
if (ptr)
|
||||||
else ptr = path_filename;
|
ptr++;
|
||||||
|
else
|
||||||
return ptr;
|
ptr = path_filename;
|
||||||
|
|
||||||
|
return ptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
char load (ImlibImage *im, ImlibProgressFunction progress,
|
char
|
||||||
char progress_granularity, char immediate_load)
|
load(ImlibImage * im, ImlibProgressFunction progress,
|
||||||
|
char progress_granularity, char immediate_load)
|
||||||
{
|
{
|
||||||
char file[4096], key[4096], *ptr;
|
char file[4096], *ptr;
|
||||||
char *str_gz;
|
char *str_gz;
|
||||||
ImlibLoader *sub_loader;
|
ImlibLoader *sub_loader;
|
||||||
|
char *tmpdir;
|
||||||
|
|
||||||
|
str_gz = malloc(4096);
|
||||||
|
|
||||||
if (im->data)
|
if (im->data)
|
||||||
return 0;
|
return 0;
|
||||||
if (!im->file)
|
if (!im->file)
|
||||||
return 0;
|
return 0;
|
||||||
strncpy(file, im->real_file, sizeof(file));
|
strncpy(file, im->real_file, sizeof(file));
|
||||||
file[sizeof(file) - 1] = 0;
|
file[sizeof(file) - 1] = 0;
|
||||||
if (!exists(file))
|
if (!exists(file))
|
||||||
|
return 0;
|
||||||
|
ptr = strrchr(file, '.');
|
||||||
|
if (!ptr)
|
||||||
return 0;
|
return 0;
|
||||||
ptr = strrchr(file,'.');
|
|
||||||
if (!ptr) return 0;
|
|
||||||
*ptr = 0;
|
*ptr = 0;
|
||||||
if (getenv("TMPDIR"))
|
if (!(tmpdir = getenv("TMPDIR")))
|
||||||
{
|
tmpdir = "/tmp";
|
||||||
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 (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);
|
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);
|
im->real_file = strdup(str_gz);
|
||||||
free(str_gz);
|
free(str_gz);
|
||||||
im->format = strdup(++ptr);
|
im->format = strdup(++ptr);
|
||||||
sub_loader = __imlib_FindBestLoaderForFile(im->real_file);
|
sub_loader = __imlib_FindBestLoaderForFile(im->real_file);
|
||||||
if (sub_loader)
|
if (sub_loader)
|
||||||
sub_loader->load(im, progress, progress_granularity,1);
|
sub_loader->load(im, progress, progress_granularity, 1);
|
||||||
else
|
else
|
||||||
{ unlink(im->real_file);
|
{
|
||||||
return 0;
|
unlink(im->real_file);
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
unlink(im->real_file);
|
unlink(im->real_file);
|
||||||
free(im->real_file);
|
free(im->real_file);
|
||||||
*--ptr = '.';
|
*--ptr = '.';
|
||||||
im->real_file=strdup(real_file);
|
im->real_file = strdup(file);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
char save (ImlibImage *im, ImlibProgressFunction progress,
|
char
|
||||||
char progress_granularity)
|
save(ImlibImage * im, ImlibProgressFunction progress, char progress_granularity)
|
||||||
{
|
{
|
||||||
/* TODO */
|
/* TODO */
|
||||||
return 0;
|
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]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue