Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

esmero-cantaloupe is not serving PNG via graphicsmagic processor #1

Open
DiegoPino opened this issue Oct 21, 2019 · 3 comments
Open
Assignees
Labels
bug Something isn't working

Comments

@DiegoPino
Copy link
Member

What is the problem?

@mitchellkeaney in its eternal wisdom was testing some ingest combinations and added a PNG file to an ADO. Result. an 500 error on loading the Image via Cantaloupe. I replicated the error locally, same here.

Cantaloupe is setup to use the "faster" graphicsmagic processor for PNG but even if i'm pretty sure i compiled the binary in our dockerfile correctly (which by now means i did not) it can not handle PNG files.

How to replicate/reproduce?

Create a new Digital Object, on the last Upload step, upload an PNG instead of an JP2/JPEG. Save metadata, but don't save the node yet.

Open a terminal

Type

docker logs esmero-cantaloupe -f

Now save the node

See how you get a 500 error, or a spinning wheel of death in the bookreader and also a bit chunk of errors in the console.

18:34:11.238 [qtp959447386-16] INFO  e.i.l.c.p.GraphicsMagickProcessor - readImageInfo(): invoking /usr/bin/gm identify -ping -format %w%h%[EXIF:Orientation] png:-
18:34:11.342 [qtp959447386-16] ERROR o.r.C.RestletApplication - Exception or error caught in server resource
org.restlet.resource.ResourceException: Internal Server Error (500) - The server encountered an unexpected condition which prevented it from fulfilling the request
	at org.restlet.resource.ServerResource.doHandle(ServerResource.java:527)

This can also be replicated by running /usr/bin/gm identify -ping -format %w%h%[EXIF:Orientation] /var/cache/source/your/hash/for/the/just/fetched/png

Funny business is that the binary says it has png support

/usr/bin/gm identify -version
GraphicsMagick 1.3.30 2018-06-23 Q8 http://www.GraphicsMagick.org/
Copyright (C) 2002-2018 GraphicsMagick Group.
Additional copyrights and licenses apply to this software.
See http://www.GraphicsMagick.org/www/Copyright.html for details.

Feature Support:
  Native Thread Safe       yes
  Large Files (> 32 bit)   yes
  Large Memory (> 32 bit)  yes
  BZIP                     yes
  DPS                      no
  FlashPix                 no
  FreeType                 yes
  Ghostscript (Library)    yes
  JBIG                     no
  JPEG-2000                yes
  JPEG                     yes
  Little CMS               yes
  Loadable Modules         yes
  OpenMP                   yes (201511)
  PNG                      yes
  TIFF                     yes
  TRIO                     no
  UMEM                     no
  WebP                     no
  WMF                      yes
  X11                      yes
  XML                      yes
  ZLIB                     yes

Host type: x86_64-unknown-linux-gnu

Configured using the command:
  ./configure  '--build=' '--host=' '--prefix=/usr' '--sysconfdir=/etc' '--enable-magick-compat' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--localstatedir=/var' '--enable-shared' '--disable-static' '--with-gslib' '--with-modules=yes' '--with-threads' '--with-webp=yes' '--with-tiff=yes' '--with-jpeg=yes' '--with-jp2=yes' '--with-png=yes' '--with-xml=yes' '--with-wmf=yes' '--with-gs-font-dir=/usr/share/fonts/Type1' '--with-quantum-depth=8' 'build_alias=' 'host_alias='

Final Build Parameters:
  CC       = gcc
  CFLAGS   = -fopenmp -g -O2 -Wall
  CPPFLAGS = -I/usr/include/freetype2 -I/usr/include/libxml2
  CXX      = g++
  CXXFLAGS = 
  LDFLAGS  = -L/lib
  LIBS     = -llcms2 -lfreetype -lgs -lX11 -lbz2 -lz -lltdl -lm -lgomp -lpthread

But the LIBS list seem to be missing png there. Did i miss a step here?
https://github.com/esmero/archipelago-docker-images/blob/master/esmero-cantaloupe/Dockerfile#L62-L87

@DiegoPino DiegoPino added the bug Something isn't working label Oct 21, 2019
@DiegoPino
Copy link
Member Author

@giancarlobi pinging you since you are the IIIF master of the universe. @marlo-longley not urgent, but this is a good change of getting into devops.

@DiegoPino
Copy link
Member Author

Some updates on this @marlo-longley the -lpng library seems to be missing so probably adding to the first library, after here a https://github.com/esmero/archipelago-docker-images/blob/master/esmero-cantaloupe/Dockerfile#L51, an extra libpng should suffice?
Seems like zlib is also there already.
Once fixed, tested and redeployed, we need to update our repo, and push a new version of this docker container and update the version deployment info docker-compose file

@giancarlobi
Copy link

@DiegoPino @marlo-longley I check this on my archipelago without docker which uses an external undockerize cantaloupe and the issue is not present: http://archipelago.byterfly.eu/node/26
The cantaloupe is running version 4.1.3 and settings are:

processor.selection_strategy = ManualSelectionStrategy
# These format-specific definitions are optional.
processor.ManualSelectionStrategy.avi = FfmpegProcessor
processor.ManualSelectionStrategy.bmp =
processor.ManualSelectionStrategy.dcm = ImageMagickProcessor
processor.ManualSelectionStrategy.flv = FfmpegProcessor
processor.ManualSelectionStrategy.gif =
processor.ManualSelectionStrategy.jp2 = KakaduNativeProcessor
processor.ManualSelectionStrategy.jpg =
processor.ManualSelectionStrategy.mov = FfmpegProcessor
processor.ManualSelectionStrategy.mp4 = FfmpegProcessor
processor.ManualSelectionStrategy.mpg = FfmpegProcessor
processor.ManualSelectionStrategy.pdf = PdfBoxProcessor
processor.ManualSelectionStrategy.png =
processor.ManualSelectionStrategy.tif =
processor.ManualSelectionStrategy.webm = FfmpegProcessor
processor.ManualSelectionStrategy.webp = ImageMagickProcessor
# Fall back to this processor for any formats not assigned above.
processor.ManualSelectionStrategy.fallback = Java2dProcessor

So png are managed by Java2d processor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants