summaryrefslogtreecommitdiff
path: root/apps/plugins/imageviewer/jpeg
diff options
context:
space:
mode:
authorRoman Artiukhin <bahusdrive@gmail.com>2024-10-14 21:33:40 +0300
committerChristian Soffke <christian.soffke@gmail.com>2024-10-28 12:46:51 -0400
commit55a5bfe7409677a26437651798abbc6d87b56089 (patch)
tree7ab7d96f52ee15257b174e75f15abae1f09b74cf /apps/plugins/imageviewer/jpeg
parentc1bcebd9986b1e2120fd05ead67754d444dae7d3 (diff)
downloadrockbox-55a5bfe7409677a26437651798abbc6d87b56089.tar.gz
rockbox-55a5bfe7409677a26437651798abbc6d87b56089.zip
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
Diffstat (limited to 'apps/plugins/imageviewer/jpeg')
-rw-r--r--apps/plugins/imageviewer/jpeg/jpeg.c14
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
112static int load_image(char *filename, struct image_info *info, 112static 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;