Results 1 to 2 of 2
  1. #1
    jiapei100 is offline Member
    Join Date
    Aug 2009
    Location
    Richmond, Canada
    Posts
    15
    Rep Power
    0

    Default how to effectively use SWT ImageLoader??

    Hi, all:

    I've got a very interesting question to ask here.
    The code looks like the following:

    1) loading
    Java Code:
    String filename ="loaded.jpg";
    ImageLoader loader = new ImageLoader();
    ImageData imagedata0 = loader.load(filename)[0];
    2) saving directly
    Java Code:
    ImageLoader imageLoader = new ImageLoader();
    imageLoader.data 		= new ImageData[] {imagedata0};
    imageLoader.save("saved.jpg",SWT.IMAGE_JPEG);
    The directly saved image (without any image processing) after loading
    is not the same as the loaded image.
    Please pay attention to the boundary of both faces.

    Can anybody help to explain this?
    Does that mean, the loading process and the saving process
    of SWT ImageLoader are not reversible?
    The loaded image is:

    The saved image is:


    Or, SWT may load various types of .jpg files,
    but may only save into a specific type of .jpg file?
    Anyway, can anybody help to explain this?


    Best Regards
    JIA
    Last edited by jiapei100; 09-26-2010 at 03:10 PM.
    Welcome to Vision Open
    http://www.visionopen.com

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,306
    Rep Power
    25

    Default

    It could be something to do with the compression that goes on with jpeg images. You can lose some details every time you write out a new jpeg. Try using another image format and see if it changes.

Similar Threads

  1. How to parse String effectively based on a dilimiter
    By raghu408 in forum Advanced Java
    Replies: 26
    Last Post: 04-10-2008, 10:55 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •