From 55a5bfe7409677a26437651798abbc6d87b56089 Mon Sep 17 00:00:00 2001 From: Roman Artiukhin Date: Mon, 14 Oct 2024 21:33:40 +0300 Subject: View Album Art from WPS context menu Add ability to imageviewer to view current track embedded/folder album art Add "View Album Art" WPS context menu item Change-Id: I49caebd38e5e3e2910d418bbeaa5e51da0e6bd93 --- apps/plugins/imageviewer/jpeg/jpeg.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'apps/plugins/imageviewer/jpeg/jpeg.c') 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) } static int load_image(char *filename, struct image_info *info, - unsigned char *buf, ssize_t *buf_size) + unsigned char *buf, ssize_t *buf_size, + int offset, int filesize) { int fd; - int filesize; unsigned char* buf_jpeg; /* compressed JPEG image */ int status; struct jpeg *p_jpg = &jpg; @@ -127,7 +127,15 @@ static int load_image(char *filename, struct image_info *info, rb->splashf(HZ, "err opening %s: %d", filename, fd); return PLUGIN_ERROR; } - filesize = rb->filesize(fd); + + if (offset) + { + rb->lseek(fd, offset, SEEK_SET); + } + else + { + filesize = rb->filesize(fd); + } /* allocate JPEG buffer */ buf_jpeg = buf; -- cgit v1.2.3