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"
|
||||
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 "
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
16
imlib2.spec
16
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 <raster@rasterman.com>
|
||||
- Fix Requires & BuildRequires for freetype.
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
/* 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 <config.h>
|
||||
|
@ -22,11 +22,11 @@
|
|||
#include <errno.h>
|
||||
#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)
|
||||
|
@ -38,26 +38,33 @@ exists(char *file)
|
|||
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__
|
||||
/* Care about \\ */
|
||||
/* Care about \\ */
|
||||
#endif
|
||||
if (ptr) ptr++;
|
||||
else ptr = path_filename;
|
||||
if (ptr)
|
||||
ptr++;
|
||||
else
|
||||
ptr = path_filename;
|
||||
|
||||
return ptr;
|
||||
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;
|
||||
|
@ -67,74 +74,65 @@ char load (ImlibImage *im, ImlibProgressFunction progress,
|
|||
file[sizeof(file) - 1] = 0;
|
||||
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);
|
||||
sub_loader->load(im, progress, progress_granularity, 1);
|
||||
else
|
||||
{ unlink(im->real_file);
|
||||
return 0;
|
||||
{
|
||||
unlink(im->real_file);
|
||||
return 0;
|
||||
}
|
||||
unlink(im->real_file);
|
||||
free(im->real_file);
|
||||
*--ptr = '.';
|
||||
im->real_file=strdup(real_file);
|
||||
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;
|
||||
/* TODO */
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
formats (ImlibLoader *l)
|
||||
formats(ImlibLoader * l)
|
||||
{
|
||||
char *list_formats[] =
|
||||
{ "gz","bz2" };
|
||||
char *list_formats[] = { "gz", "bz2" };
|
||||
|
||||
{
|
||||
int i;
|
||||
{
|
||||
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]);
|
||||
}
|
||||
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