You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm seeing vipsthumbnail produce valid but obviously incorrect thumbnails for some SVS files. Strangely, it only seems to apply when running in an Alpine container. Running the same command with the same vips version on OSX is working fine.
Here's an example of an incorrect thumbnail (blue rectangle added by me to hide medical data). The white areas directly above and to the left of the rectangle are incorrect and not in the original image:
Unfortunately I can't provide the original image here.
To Reproduce
Dockerfile:
FROM openjdk:14-alpine
ARG OPENSLIDE_VERSION=3.4.1
ARG VIPS_VERSION=8.10.0
WORKDIR /root
RUN apk add --virtual build-deps build-base zlib-dev libpng-dev jpeg-dev tiff-dev openjpeg-dev gdk-pixbuf-dev \
sqlite-dev cairo-dev libxml2-dev libgsf-dev libexif-dev \
# Download, build, and install Openslide
&& wget https://github.com/openslide/openslide/releases/download/v$OPENSLIDE_VERSION/openslide-$OPENSLIDE_VERSION.tar.gz \
&& tar xzf openslide-$OPENSLIDE_VERSION.tar.gz \
&& cd openslide-$OPENSLIDE_VERSION && ./configure && make && make install && cd .. && rm -rf openslide-$OPENSLIDE_VERSION* \
# Download, build, and install Vips
&& wget https://github.com/libvips/libvips/releases/download/v$VIPS_VERSION/vips-$VIPS_VERSION.tar.gz \
&& tar xzf vips-$VIPS_VERSION.tar.gz \
&& cd vips-$VIPS_VERSION && ./configure && make V=0 && make && make install && cd .. && rm -rf vips-$VIPS_VERSION* \
# Cleanup build deps
&& apk del build-deps \
# Add runtime deps
&& apk add --virtual run-deps zlib libpng jpeg tiff openjpeg gdk-pixbuf sqlite-libs cairo libxml2 libgsf libexif
ENTRYPOINT "/bin/sh"
Additional context
I'm not sure how to provide enough useful information without the original image. Maybe I could email a download link (but I'll need to check if that's possible first). Here are the operation cache dumps:
Working on OSX (produces good thumbnail):
Operation cache:
0x7fcf7805a4f0 - openslideload("weird_thumbnail.svs",((VipsImage*) 0x7fcf7881b1b0),nickname="openslideload",description="load file with OpenSlide",flags=((VipsForeignFlags) VIPS_FOREIGN_PARTIAL))
0x7fcf78076ff0 - embed(((VipsImage*) 0x7fcf7881bca0),((VipsImage*) 0x7fcf7885c320),0,0,2149,669,nickname="embed",description="embed an image in a larger image",extend=((VipsExtend) VIPS_EXTEND_COPY))
0x7fcf78092cb0 - resize(((VipsImage*) 0x7fcf7881b660),((VipsImage*) 0x7fcf7881b980),0.238472,nickname="resize",description="resize an image",vscale=0.238472)
0x7fcf78065130 - colourspace(((VipsImage*) 0x7fcf7881b340),((VipsImage*) 0x7fcf7881b4d0),((VipsInterpretation) VIPS_INTERPRETATION_sRGB),nickname="colourspace",description="convert to a new colorspace")
0x7fcf78091200 - reduceh(((VipsImage*) 0x7fcf7885c4b0),((VipsImage*) 0x7fcf7885caf0),1.000000,2.096680,nickname="reduceh",description="shrink an image horizontally",kernel=((VipsKernel) VIPS_KERNEL_LANCZOS3))
0x7fcf78097650 - unpremultiply(((VipsImage*) 0x7fcf7881b980),((VipsImage*) 0x7fcf78863020),nickname="unpremultiply",description="unpremultiply image alpha")
0x7fcf780a8200 - cast(((VipsImage*) 0x7fcf78863980),((VipsImage*) 0x7fcf78863ca0),((VipsBandFormat) VIPS_FORMAT_UCHAR),nickname="cast",description="cast an image")
0x7fcf78078960 - shrinkh(((VipsImage*) 0x7fcf7881bca0),((VipsImage*) 0x7fcf7885c190),1,2,nickname="shrinkh",description="shrink an image horizontally")
0x7fcf780a5d70 - flatten(((VipsImage*) 0x7fcf788637f0),((VipsImage*) 0x7fcf78863980),nickname="flatten",background=0 ,description="flatten alpha out of an image")
0x7fcf76c197c0 - tilecache(((VipsImage*) 0x7fcf788694d0),((VipsImage*) 0x7fcf78869660),nickname="tilecache",description="cache an image as a set of tiles",tile-width=240,tile-height=240,max-tiles=22,threaded=TRUE)
0x7fcf78073f80 - shrinkv(((VipsImage*) 0x7fcf7881bb10),((VipsImage*) 0x7fcf7881bca0),1,2,nickname="shrinkv",description="shrink an image vertically")
0x7fcf780a0d90 - colourspace(((VipsImage*) 0x7fcf78863660),((VipsImage*) 0x7fcf788637f0),((VipsInterpretation) VIPS_INTERPRETATION_sRGB),nickname="colourspace",description="convert to a new colorspace")
0x7fcf7809bee0 - cast(((VipsImage*) 0x7fcf78863020),((VipsImage*) 0x7fcf78863340),((VipsBandFormat) VIPS_FORMAT_UCHAR),nickname="cast",description="cast an image")
0x7fcf78080e80 - embed(((VipsImage*) 0x7fcf7885c640),((VipsImage*) 0x7fcf7885c7d0),0,5,1074,682,nickname="embed",description="embed an image in a larger image",extend=((VipsExtend) VIPS_EXTEND_COPY))
0x7fcf780703c0 - embed(((VipsImage*) 0x7fcf7881bb10),((VipsImage*) 0x7fcf7881be30),0,0,2147,1338,nickname="embed",description="embed an image in a larger image",extend=((VipsExtend) VIPS_EXTEND_COPY))
0x7fcf7808f7a0 - embed(((VipsImage*) 0x7fcf7885cc80),((VipsImage*) 0x7fcf7885ce10),5,0,1087,319,nickname="embed",description="embed an image in a larger image",extend=((VipsExtend) VIPS_EXTEND_COPY))
0x7fcf780848e0 - reducev(((VipsImage*) 0x7fcf7885c190),((VipsImage*) 0x7fcf7885c4b0),1.000000,2.096680,nickname="reducev",description="shrink an image vertically",kernel=((VipsKernel) VIPS_KERNEL_LANCZOS3))
0x7fcf78069c00 - premultiply(((VipsImage*) 0x7fcf7881b4d0),((VipsImage*) 0x7fcf7881b660),nickname="premultiply",description="premultiply image alpha")
0x7fcf780629d0 - openslideload("weird_thumbnail.svs",((VipsImage*) 0x7fcf7881b340),nickname="openslideload",description="load file with OpenSlide",level=3,flags=((VipsForeignFlags) VIPS_FOREIGN_PARTIAL),access=((VipsAccess) VIPS_ACCESS_SEQUENTIAL))
Not working on Alpine Docker container (produces bad thumbnail):
vipsthumbnail --vips-cache-dump --size=512 -o %s-thumbnail.jpg weird_thumbnail.svs
Operation cache:
0x5617a580b220 - reducev(((VipsImage*) 0x5617a57e51a0),((VipsImage*) 0x5617a57e54c0),1.000000,2.096680,nickname="reducev",description="shrink an image vertically",kernel=((VipsKernel) VIPS_KERNEL_LANCZOS3))
0x5617a57f6340 - embed(((VipsImage*) 0x5617a5731c90),((VipsImage*) 0x5617a57e5330),0,0,2149,669,nickname="embed",description="embed an image in a larger image",extend=((VipsExtend) VIPS_EXTEND_COPY))
0x5617a57f8b80 - shrinkh(((VipsImage*) 0x5617a5731c90),((VipsImage*) 0x5617a57e51a0),1,2,nickname="shrinkh",description="shrink an image horizontally")
0x5617a57bc760 - openslideload("weird_thumbnail.svs",((VipsImage*) 0x5617a57311a0),nickname="openslideload",description="load file with OpenSlide",flags=((VipsForeignFlags) VIPS_FOREIGN_PARTIAL))
0x5617a5820ee0 - resize(((VipsImage*) 0x5617a5731650),((VipsImage*) 0x5617a5731970),0.238472,nickname="resize",description="resize an image",vscale=0.238472)
0x5617a583af60 - colourspace(((VipsImage*) 0x5617a5822640),((VipsImage*) 0x5617a58227d0),((VipsInterpretation) VIPS_INTERPRETATION_sRGB),nickname="colourspace",description="convert to a new colorspace")
0x5617a5842fe0 - flatten(((VipsImage*) 0x5617a58227d0),((VipsImage*) 0x5617a5822960),nickname="flatten",background=0 ,description="flatten alpha out of an image")
0x5617a5831920 - cast(((VipsImage*) 0x5617a5822000),((VipsImage*) 0x5617a5822320),((VipsBandFormat) VIPS_FORMAT_UCHAR),nickname="cast",description="cast an image")
0x5617a57f20c0 - shrinkv(((VipsImage*) 0x5617a5731b00),((VipsImage*) 0x5617a5731c90),1,2,nickname="shrinkv",description="shrink an image vertically")
0x5617a581e840 - reduceh(((VipsImage*) 0x5617a57e54c0),((VipsImage*) 0x5617a57e5b00),1.000000,2.096680,nickname="reduceh",description="shrink an image horizontally",kernel=((VipsKernel) VIPS_KERNEL_LANCZOS3))
0x5617a57ec840 - embed(((VipsImage*) 0x5617a5731b00),((VipsImage*) 0x5617a5731e20),0,0,2147,1338,nickname="embed",description="embed an image in a larger image",extend=((VipsExtend) VIPS_EXTEND_COPY))
0x5617a581c200 - embed(((VipsImage*) 0x5617a57e5c90),((VipsImage*) 0x5617a57e5e20),5,0,1087,319,nickname="embed",description="embed an image in a larger image",extend=((VipsExtend) VIPS_EXTEND_COPY))
0x5617a5805d00 - embed(((VipsImage*) 0x5617a57e5650),((VipsImage*) 0x5617a57e57e0),0,5,1074,682,nickname="embed",description="embed an image in a larger image",extend=((VipsExtend) VIPS_EXTEND_COPY))
0x5617a57df480 - premultiply(((VipsImage*) 0x5617a57314c0),((VipsImage*) 0x5617a5731650),nickname="premultiply",description="premultiply image alpha")
0x5617a582ace0 - unpremultiply(((VipsImage*) 0x5617a5731970),((VipsImage*) 0x5617a5822000),nickname="unpremultiply",description="unpremultiply image alpha")
0x5617a57ca120 - openslideload("weird_thumbnail.svs",((VipsImage*) 0x5617a5731330),nickname="openslideload",description="load file with OpenSlide",level=3,flags=((VipsForeignFlags) VIPS_FOREIGN_PARTIAL),access=((VipsAccess) VIPS_ACCESS_SEQUENTIAL))
0x5617a57d79a0 - colourspace(((VipsImage*) 0x5617a5731330),((VipsImage*) 0x5617a57314c0),((VipsInterpretation) VIPS_INTERPRETATION_sRGB),nickname="colourspace",description="convert to a new colorspace")
0x5617a5847b20 - cast(((VipsImage*) 0x5617a5822960),((VipsImage*) 0x5617a5822c80),((VipsBandFormat) VIPS_FORMAT_UCHAR),nickname="cast",description="cast an image")
0x5617a5cfdf40 - tilecache(((VipsImage*) 0x5617a58444b0),((VipsImage*) 0x5617a5844640),nickname="tilecache",description="cache an image as a set of tiles",tile-width=240,tile-height=240,max-tiles=22,threaded=TRUE)
The text was updated successfully, but these errors were encountered:
I'm seeing
vipsthumbnail
produce valid but obviously incorrect thumbnails for some SVS files. Strangely, it only seems to apply when running in an Alpine container. Running the same command with the same vips version on OSX is working fine.Here's an example of an incorrect thumbnail (blue rectangle added by me to hide medical data). The white areas directly above and to the left of the rectangle are incorrect and not in the original image:
Unfortunately I can't provide the original image here.
To Reproduce
Dockerfile:
docker build -t weird_thumbnail:latest .
docker run -it weird_thumbnail:latest
vipsthumbnail --size=512 -o %s-thumbnail.jpg weird_thumbnail.svs
Additional context
I'm not sure how to provide enough useful information without the original image. Maybe I could email a download link (but I'll need to check if that's possible first). Here are the operation cache dumps:
Working on OSX (produces good thumbnail):
Not working on Alpine Docker container (produces bad thumbnail):
The text was updated successfully, but these errors were encountered: