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

outstanding issues with image module #2261

Open
duncdrum opened this issue Nov 2, 2018 · 2 comments
Open

outstanding issues with image module #2261

duncdrum opened this issue Nov 2, 2018 · 2 comments
Labels
bug issue confirmed as bug enhancement new features, suggestions, etc.

Comments

@duncdrum
Copy link
Contributor

duncdrum commented Nov 2, 2018

What is the problem

  • Currently the xquery functions exposed by the image module are not tested.
  • Support for imageIO varies between different Java engines, in particular openJDK has some nasty bugs, which are unlikely to get fixed any time soon. s.b.
  • Transformation functions inadvertently strip alpha channels in both jpg and png and convert them to black (or whatever default background color is defined elsewhere).
  • Crop and scale use heightxwidth in their function signature for dimensions, this is against the widely adopted standard which is widthxheight

What did you expect

  • unit tests for the various functions
  • working with JPEG images either results in (for non RGB color profiles)
02 Nov 2018 17:38:42,773 [qtp443401609-49] ERROR (CropFunction.java [eval]:154) - Unable to read image data! 

or when running in openJDK (with supported jpeg)

<error type="java:java.lang.NoClassDefFoundError" message="Could not initialize class com.sun.imageio.plugins.jpeg.JPEGImageReader"/>

this means we can't process JPEG within our docker images

  • The colors in the following two images to look identical
original transformed
image scaledpng
  • image dimensions to follow common practice of walking down the hall to get to the elevator (Width x Height)

Describe how to reproduce or add a test

xquery version "3.1";

import module namespace image="http://exist-db.org/xquery/image";

declare variable $testCol := '/db/GH/2242';
declare variable $png := 'https://www.google.com/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png';
let $store := xmldb:store(
        $testCol, 
        'image.png',
        hc:send-request(<hc:request href="{$png}" method="get"/>)[2]
let $somePNG := util:binary-doc($testCol || '/image.png')

return
  xmldb:store('/db/GH/2242', 'scaled.png', image:scale($somePNG, (),'image/png'))

Context information

Please always add the following information

  • eXist-db 4.4.0
  • Java version (e.g. Java8u181 Java8u191) openJDK / oracleJDK
  • Operating system ( Linux, MacOs)
  • 64 bit
  • How is eXist-db installed? ( DMG, clone from GitHub, docker)
  • Any custom changes in e.g. conf.xml. n.a.
@triage-new-issues triage-new-issues bot added the triage issue needs to be investigated label Nov 2, 2018
@dizzzz
Copy link
Member

dizzzz commented Nov 2, 2018

@duncdrum regarding the "Could not initialize class com.sun.imageio.plugins.jpeg.JPEGImageReader" ... this makes sense ; do you have a full trace? is this without the JAI module installed?

@duncdrum duncdrum added bug issue confirmed as bug enhancement new features, suggestions, etc. labels Jan 8, 2019
@triage-new-issues triage-new-issues bot removed the triage issue needs to be investigated label Jan 8, 2019
@duncdrum
Copy link
Contributor Author

duncdrum commented Jan 8, 2019

see #805

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug issue confirmed as bug enhancement new features, suggestions, etc.
Projects
None yet
Development

No branches or pull requests

2 participants