diff options
Diffstat (limited to 'apps/plugins/imageviewer/jpeg')
-rw-r--r-- | apps/plugins/imageviewer/jpeg/jpeg.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/apps/plugins/imageviewer/jpeg/jpeg.c b/apps/plugins/imageviewer/jpeg/jpeg.c index c231209beb..c7969c10c9 100644 --- a/apps/plugins/imageviewer/jpeg/jpeg.c +++ b/apps/plugins/imageviewer/jpeg/jpeg.c | |||
@@ -110,10 +110,10 @@ static int img_mem(int ds) | |||
110 | } | 110 | } |
111 | 111 | ||
112 | static int load_image(char *filename, struct image_info *info, | 112 | static int load_image(char *filename, struct image_info *info, |
113 | unsigned char *buf, ssize_t *buf_size) | 113 | unsigned char *buf, ssize_t *buf_size, |
114 | int offset, int filesize) | ||
114 | { | 115 | { |
115 | int fd; | 116 | int fd; |
116 | int filesize; | ||
117 | unsigned char* buf_jpeg; /* compressed JPEG image */ | 117 | unsigned char* buf_jpeg; /* compressed JPEG image */ |
118 | int status; | 118 | int status; |
119 | struct jpeg *p_jpg = &jpg; | 119 | struct jpeg *p_jpg = &jpg; |
@@ -127,7 +127,15 @@ static int load_image(char *filename, struct image_info *info, | |||
127 | rb->splashf(HZ, "err opening %s: %d", filename, fd); | 127 | rb->splashf(HZ, "err opening %s: %d", filename, fd); |
128 | return PLUGIN_ERROR; | 128 | return PLUGIN_ERROR; |
129 | } | 129 | } |
130 | filesize = rb->filesize(fd); | 130 | |
131 | if (offset) | ||
132 | { | ||
133 | rb->lseek(fd, offset, SEEK_SET); | ||
134 | } | ||
135 | else | ||
136 | { | ||
137 | filesize = rb->filesize(fd); | ||
138 | } | ||
131 | 139 | ||
132 | /* allocate JPEG buffer */ | 140 | /* allocate JPEG buffer */ |
133 | buf_jpeg = buf; | 141 | buf_jpeg = buf; |