Uploaded image for project: 'Seam 2'
  1. Seam 2
  2. JBSEAM-1592

<s:graphicImage> should accept raw byte[] without conversion

    Details

    • Type: Feature Request
    • Status: Open (View Workflow)
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 1.2.1.GA, 1.3.0.ALPHA, 2.0.0.BETA1
    • Fix Version/s: None
    • Component/s: JSF Controls
    • Labels:
      None
    • Environment:

      latest from repo

      Description

      It would be helpful to feed the <s:graphicImage> with raw byte[] (possible also ByteArray - stream) without converting it to BufferedImage or something else. Also the content type could be manually entered. Of course, its in the responsibility of the developer, to take care about the correctness of input. Optional attributes (forceContentType, forceImage or something else) could do this job on the UI side.

      Background of the request:

      if i comment out the byte[] handling in Image.class (line 404 method readImage()) as in a following snipplet, i get an expected quality. Otherwise, the image quality decreases significantly, especially for small images (icons, thumbnails).

      /*
      byte[] b = (byte[]) input;
      readImage(new ByteArrayInputStream(b));
      */

      output = (byte[]) input;

      I also would have some possibility, to prepare the image on demand. Currently i'm using two servlets: one SeamResource and one for my images. My servlet receives an URI and selects an image LOB from DB, because it isn't necessary to store the images in memory (they could be large) and the images could stay unrequested. What i need is some kind callback (converter?) which asks me for byte[] or stream representation of an image uri.

      Thanks

      Gena

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                gena777 Gena
              • Votes:
                5 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated: