Skip to content

Commit

Permalink
fixed libjpeg in autoconf
Browse files Browse the repository at this point in the history
  • Loading branch information
nadvornik committed Sep 27, 2011
1 parent 18f8e33 commit 0ec34da
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 1 deletion.
3 changes: 2 additions & 1 deletion configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,8 @@ AC_ARG_ENABLE([jpeg],
if test "x${libjpeg}" != "xno"; then
AC_CHECK_LIB(jpeg, jpeg_destroy_decompress,
HAVE_JPEG=yes
JPEG_LIBS=-ljpeg,
JPEG_LIBS=-ljpeg
AC_DEFINE(HAVE_JPEG, 1, [define to enable use of custom jpeg loader]),
HAVE_JPEG=no)
else
HAVE_JPEG=disabled
Expand Down
1 change: 1 addition & 0 deletions po/POTFILES.in
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ src/history_list.c
src/image.c
src/image-load.c
src/image-overlay.c
src/image_load_jpeg.c
src/img-view.c
src/layout.c
src/layout_config.c
Expand Down
2 changes: 2 additions & 0 deletions src/image-load.c
Original file line number Diff line number Diff line change
Expand Up @@ -513,12 +513,14 @@ static void image_loader_stop_loader(ImageLoader *il)
static void image_loader_setup_loader(ImageLoader *il)
{
g_mutex_lock(il->data_mutex);
#ifdef HAVE_JPEG
if (il->bytes_total >= 2 && il->mapped_file[0] == 0xff && il->mapped_file[1] == 0xd8)
{
DEBUG_1("Using custom jpeg loader");
image_loader_backend_set_jpeg(&il->backend);
}
else
#endif
image_loader_backend_set_default(&il->backend);

il->loader = il->backend.loader_new(image_loader_area_updated_cb, image_loader_size_cb, image_loader_area_prepared_cb, il);
Expand Down
4 changes: 4 additions & 0 deletions src/image_load_jpeg.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,13 @@


#include "main.h"

#include "image-load.h"
#include "image_load_jpeg.h"
#include "jpeg_parser.h"

#ifdef HAVE_JPEG

#include <setjmp.h>
#include <jpeglib.h>
#include <jerror.h>
Expand Down Expand Up @@ -489,3 +492,4 @@ void image_loader_backend_set_jpeg(ImageLoaderBackend *funcs)



#endif
2 changes: 2 additions & 0 deletions src/image_load_jpeg.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
#ifndef IMAGE_LOAD_JPEG_H
#define IMAGE_LOAD_JPEG_H

#ifdef HAVE_JPEG
void image_loader_backend_set_jpeg(ImageLoaderBackend *funcs);
#endif

#endif

0 comments on commit 0ec34da

Please sign in to comment.