bugKawa - Bugs: bug #49367, (kawa pictures) image-write gives...

 
 

bug #49367: (kawa pictures) image-write gives exception on pictures

Submitted by:  Sudarshan S Chawathe <chaw>
Submitted on:  Sun 16 Oct 2016 08:23:41 PM UTC  
 
Category: Scheme librarySeverity: 3 - Normal
Item Group: Run-time exceptionStatus: Fixed
Privacy: PublicAssigned to: Per Bothner <bothner>
Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Sun 23 Oct 2016 09:39:59 PM UTC, comment #2:

This change seems to have fixed the problem. Thanks!

[Tested with the SVN version of around 5:00 pm EDT today.]

Sudarshan S Chawathe <chaw>
Sun 23 Oct 2016 02:43:53 PM UTC, comment #1:

Strange. It works for me with Java SE 1.8.0_74-b02 on Fedora. Possibly a (fixed) bug in ImageIO.

Regardless, writing something that isn't a BufferedImage is less efficient (based on glancing at the OpenJDK source). Since a DrawImage wraps a BufferedImage, might as well pass that instead to ImageIO.write. I checked in a change to do that. Please let me now if that solves the problem.

Per Bothner <bothner>
Project AdministratorIn charge of this item.
Sun 16 Oct 2016 08:23:41 PM UTC, original submission:

image-write produces a run-time exception (below) when used on a picture (even with an explicit ->image conversion). A simple example that triggers the error is below. This is with the SVN Kawa version (from yesterday) on 32-bit Debian Jessie and OpenJDK 8.

(import (kawa pictures))

(image-write (circle 30) "/tmp/t.jpg") ; error
(image-write (->image (circle 30)) "/tmp/t.jpg") ; same error

(define img1 (image-read "http://pics.bothner.com/2013/Cats/06t.jpg"))
(image-write img1 "/tmp/t.jpg") ; works

Error...

javax.imageio.IIOException: Invalid argument to native writeImage
at com.sun.imageio.plugins.jpeg.JPEGImageWriter.writeImage(Native Method)
at com.sun.imageio.plugins.jpeg.JPEGImageWriter.writeOnThread(JPEGImageWriter.java:1067)
at com.sun.imageio.plugins.jpeg.JPEGImageWriter.write(JPEGImageWriter.java:363)
at javax.imageio.ImageWriter.write(ImageWriter.java:615)
at javax.imageio.ImageIO.doWrite(ImageIO.java:1612)
at javax.imageio.ImageIO.write(ImageIO.java:1578)
at kawa.lib.kawa.pictures.imageWrite(pictures.scm:150)
at b201.run(b201.scm:3)
at gnu.expr.ModuleExp.evalModule2(ModuleExp.java:293)
at gnu.expr.CompiledModule.evalModule(CompiledModule.java:42)
at gnu.expr.CompiledModule.evalModule(CompiledModule.java:60)
at kawa.Shell.runFile(Shell.java:565)
at kawa.Shell.runFileOrClass(Shell.java:468)
at kawa.repl.processArgs(repl.java:689)
at kawa.repl.main(repl.java:811)

Sudarshan S Chawathe <chaw>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by bothner (Posted a comment)
  • -unavailable- added by chaw (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 23 Oct 2016 10:59:20 PM UTCbothnerOpen/ClosedOpen=>Closed
    Sun 23 Oct 2016 02:43:53 PM UTCbothnerStatusNone=>Fixed
      Assigned toNone=>bothner

    Back to the top


    Powered by Savane 3.1-cleanup1