Skip to main content

using wiki to develop read/write example

9 replies [Last post]
ddlthompson
Offline
Joined: 2005-04-08

i have been working on a standalone example program that reads and writes images using imageio through jai. i have included a lot more functionality than the examples that i've seen published.

the basics work, however i know there are issues with it, and there are a fair number of things that i don't know how to do, or i don't think i am doing optimally.

i have also noticed that for the imageio project there is a wiki which is essentially unused. i was wondering if there would be interest in my posting a page on the wiki with the example code, that people could look at, change, and comment, in order to create, as a group, the best possible example.

is that a reasonable use of the wiki? would people, in particular Brian and the folks at Sun, be interested in contributing to this? is the wiki actually set up for contributions?

ideally as issues are discussed on the forums, the example code could be updated to reflect the best corporate wisdom.

let me know if this seems like something worth trying. if this works it might be nice to do the same thing with a jai wiki, but with an example for each operator, for instance.

thanks

-doug

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
bpb
Offline
Joined: 2004-06-23

I think that is a reasonable use of the Wiki - it's just a matter of getting around to doing it.

Another thought would be to contribute it to the jai-imageio-demos project.

Brian

> i have been working on a standalone example program
> that reads and writes images using imageio through
> jai. i have included a lot more functionality than
> the examples that i've seen published.
>
> the basics work, however i know there are issues with
> it, and there are a fair number of things that i
> don't know how to do, or i don't think i am doing
> optimally.
>
> i have also noticed that for the imageio project
> there is a wiki which is essentially unused. i was
> wondering if there would be interest in my posting a
> page on the wiki with the example code, that people
> could look at, change, and comment, in order to
> create, as a group, the best possible example.
>
> is that a reasonable use of the wiki? would people,
> in particular Brian and the folks at Sun, be
> interested in contributing to this? is the wiki
> actually set up for contributions?
>
> ideally as issues are discussed on the forums, the
> example code could be updated to reflect the best
> corporate wisdom.
>
> let me know if this seems like something worth
> trying. if this works it might be nice to do the same
> thing with a jai wiki, but with an example for each
> operator, for instance.
>
> thanks
>
> -doug

ddlthompson
Offline
Joined: 2005-04-08

>
> Another thought would be to contribute it to the
> jai-imageio-demos project.
>
> Brian

the problem with contributing it to the demos project is that i do not believe it is exemplary code. it needs review and suggestions from others.

after it has been picked over and improved, if everyone thinks it is worthwhile, i would have no problem checking it in.

-doug

Brian Burkhalter

On Fri, 19 Jan 2007, jai-imageio@javadesktop.org wrote:

>>
>> Another thought would be to contribute it to the
>> jai-imageio-demos project.
>>
>> Brian
>
> the problem with contributing it to the demos project is that i do not believe it is exemplary code. it needs review and suggestions from others.
>
> after it has been picked over and improved, if everyone thinks it is worthwhile, i would have no problem checking it in.

Understood. I'll put this on the list of things to look into. It shouldn't be
too difficult.

Thanks,

Brian

----------------
Brian Burkhalter
Java Media, Imaging, and Graphics
Sun Microsystems, Inc.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This email message is for the sole use of the intended recipient(s)
and may contain confidential and privileged information. Any
unauthorized review, use, disclosure or distribution is prohibited.
If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
For additional commands, e-mail: interest-help@jai-imageio.dev.java.net

ddlthompson
Offline
Joined: 2005-04-08

there is no reason why i cannot create the wiki page myself, except for the strangely coincidental problem that when i went out to the wiki to create the page, the wiki was down (500 server error), and has remained down.

as soon as it is resuscitated i will add the page and notify this list.

-doug

Brian Burkhalter

Please do so. It is nice to see this. Thanks for the initiative.

Brian

On Fri, 19 Jan 2007, jai-imageio@javadesktop.org wrote:

> there is no reason why i cannot create the wiki page myself, except for the strangely coincidental problem that when i went out to the wiki to create the page, the wiki was down (500 server error), and has remained down.
>
> as soon as it is resuscitated i will add the page and notify this list.
>
> -doug
> [Message sent by forum member 'ddlthompson' (ddlthompson)]
>
> http://forums.java.net/jive/thread.jspa?messageID=196537

----------------
Brian Burkhalter
Java Media, Imaging, and Graphics
Sun Microsystems, Inc.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This email message is for the sole use of the intended recipient(s)
and may contain confidential and privileged information. Any
unauthorized review, use, disclosure or distribution is prohibited.
If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
For additional commands, e-mail: interest-help@jai-imageio.dev.java.net

ddlthompson
Offline
Joined: 2005-04-08

Brian (and everyone)-

I have now created a LoadSaveExample page off of the main wiki page, and have put my code up in that page. I have also copied it back to my machine to compile and run, and apparently nothing was lost in translation. Let me know if you have any problems.

http://wiki.java.net/bin/view/Javadesktop/JAI-ImageIO

PLEASE look this code over, copy it to your own project and try it out, and improve it as much as you can. i have put comments in the code on what is included and what still could be done. it might be worthwhile to annotate the changes at the top of the page as well.

I have used this sort of collaborative editing in other projects and it can actually work quite well. If the code gets to the point where people are comfortable with it, this may be a candidate for the demo project.

comments, problems, observations and additions (to the wiki) are welcome.

thanks,

-doug

Brian Burkhalter

Doug,

Thanks for posting this: it should prove helpful to everyone.

I would like to point one thing that I noticed when I first glanced at the
code. That is the reference to the class
com.sun.media.imageioimpl.plugins.tiff.TIFFImageWriter. In general code using
JAI Image I/O should never explicitly refer to anything which does not appear
in the javadoc generated using the "-protected" option to the 'javadoc'
utility. This sort of javadoc is what is generated when the Ant target
"docs-jcp" is used in the CVS sandbox and is what is made available online for
browsing and for download.

In this particular case I think the code

if (!(writer instanceof TIFFImageWriter))
{
writeParam.setCompressionMode( ImageWriteParam.MODE_EXPLICIT );
writeParam.setCompressionQuality( mCompression );
}

would be better replaced by

if (writeParam.canWriteCompressed())
{
writeParam.setCompressionMode( ImageWriteParam.MODE_EXPLICIT );
writeParam.setCompressionQuality( mCompression );
}

and the import of TIFFImageWriter removed. Setting the compression quality
does not hurt anything in the TIFF writer and is ignored for all but the
JPEG-in-TIFF and Zip-in-TIFF compression types.

Thanks,

Brian

On Tue, 30 Jan 2007, jai-imageio@javadesktop.org wrote:

> Brian (and everyone)-
>
> I have now created a LoadSaveExample page off of the main wiki page, and have put my code up in that page. I have also copied it back to my machine to compile and run, and apparently nothing was lost in translation. Let me know if you have any problems.
>
> http://wiki.java.net/bin/view/Javadesktop/JAI-ImageIO
>
> PLEASE look this code over, copy it to your own project and try it out, and improve it as much as you can. i have put comments in the code on what is included and what still could be done. it might be worthwhile to annotate the changes at the top of the page as well.
>
> I have used this sort of collaborative editing in other projects and it can actually work quite well. If the code gets to the point where people are comfortable with it, this may be a candidate for the demo project.
>
> comments, problems, observations and additions (to the wiki) are welcome.
>
> thanks,
>
> -doug
> [Message sent by forum member 'ddlthompson' (ddlthompson)]
>
> http://forums.java.net/jive/thread.jspa?messageID=200113
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
> For additional commands, e-mail: interest-help@jai-imageio.dev.java.net
>
>

----------------
Brian Burkhalter
Java Media, Imaging, and Graphics
Sun Microsystems, Inc.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This email message is for the sole use of the intended recipient(s)
and may contain confidential and privileged information. Any
unauthorized review, use, disclosure or distribution is prohibited.
If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
For additional commands, e-mail: interest-help@jai-imageio.dev.java.net

Brian Burkhalter

FYI I made this change in the wiki.

Brian

On Tue, 30 Jan 2007, Brian Burkhalter wrote:

> Doug,
>
> Thanks for posting this: it should prove helpful to everyone.
>
> I would like to point one thing that I noticed when I first glanced at the
> code. That is the reference to the class
> com.sun.media.imageioimpl.plugins.tiff.TIFFImageWriter. In general code using
> JAI Image I/O should never explicitly refer to anything which does not appear
> in the javadoc generated using the "-protected" option to the 'javadoc'
> utility. This sort of javadoc is what is generated when the Ant target
> "docs-jcp" is used in the CVS sandbox and is what is made available online
> for browsing and for download.
>
> In this particular case I think the code
>
> if (!(writer instanceof TIFFImageWriter))
> {
> writeParam.setCompressionMode( ImageWriteParam.MODE_EXPLICIT );
> writeParam.setCompressionQuality( mCompression );
> }
>
> would be better replaced by
>
> if (writeParam.canWriteCompressed())
> {
> writeParam.setCompressionMode( ImageWriteParam.MODE_EXPLICIT );
> writeParam.setCompressionQuality( mCompression );
> }
>
> and the import of TIFFImageWriter removed. Setting the compression quality
> does not hurt anything in the TIFF writer and is ignored for all but the
> JPEG-in-TIFF and Zip-in-TIFF compression types.
>
> Thanks,
>
> Brian
>
> On Tue, 30 Jan 2007, jai-imageio@javadesktop.org wrote:
>
>> Brian (and everyone)-
>>
>> I have now created a LoadSaveExample page off of the main wiki page, and
>> have put my code up in that page. I have also copied it back to my machine
>> to compile and run, and apparently nothing was lost in translation. Let me
>> know if you have any problems.
>>
>> http://wiki.java.net/bin/view/Javadesktop/JAI-ImageIO
>>
>> PLEASE look this code over, copy it to your own project and try it out, and
>> improve it as much as you can. i have put comments in the code on what is
>> included and what still could be done. it might be worthwhile to annotate
>> the changes at the top of the page as well.
>>
>> I have used this sort of collaborative editing in other projects and it can
>> actually work quite well. If the code gets to the point where people are
>> comfortable with it, this may be a candidate for the demo project.
>>
>> comments, problems, observations and additions (to the wiki) are welcome.
>>
>> thanks,
>>
>> -doug
>> [Message sent by forum member 'ddlthompson' (ddlthompson)]
>>
>> http://forums.java.net/jive/thread.jspa?messageID=200113
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
>> For additional commands, e-mail: interest-help@jai-imageio.dev.java.net
>>
>>
>
> ----------------
> Brian Burkhalter
> Java Media, Imaging, and Graphics
> Sun Microsystems, Inc.
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> This email message is for the sole use of the intended recipient(s)
> and may contain confidential and privileged information. Any
> unauthorized review, use, disclosure or distribution is prohibited.
> If you are not the intended recipient, please contact the sender by
> reply email and destroy all copies of the original message.
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
> For additional commands, e-mail: interest-help@jai-imageio.dev.java.net
>
>

----------------
Brian Burkhalter
Java Media, Imaging, and Graphics
Sun Microsystems, Inc.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This email message is for the sole use of the intended recipient(s)
and may contain confidential and privileged information. Any
unauthorized review, use, disclosure or distribution is prohibited.
If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
For additional commands, e-mail: interest-help@jai-imageio.dev.java.net

ddlthompson
Offline
Joined: 2005-04-08

> FYI I made this change in the wiki.
>
> Brian

cool. thanks, that was a good catch.

the other place where i feel like the code is not using the best method is in getting information from the metadata. the code is basically treating it as an xml document. i think there should be a better way to handle it, treating it as actual metadata, but i was not able to get anything else to work. is the code on the wiki the best way to approach it? (see getTiffParam(): even the name shows there is a problem..)

thanks,

doug