<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to Home</title><link>https://sourceforge.net/p/jlibjpeg/wiki/Home/</link><description>Recent changes to Home</description><atom:link href="https://sourceforge.net/p/jlibjpeg/wiki/Home/feed" rel="self"/><language>en</language><lastBuildDate>Thu, 28 Nov 2013 15:30:35 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/jlibjpeg/wiki/Home/feed" rel="self" type="application/rss+xml"/><item><title>Home modified by StephenG</title><link>https://sourceforge.net/p/jlibjpeg/wiki/Home/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v2
+++ v3
@@ -23,7 +23,7 @@
 Building JLibJPEG
 ------------------

-To build JLibJPEG you first need to compile the Java file and then use that to build the C include file with javah.  Finally you compile the C file with the native code.  THis is an example from teh developer's own system :
+To build JLibJPEG you first need to compile the Java file and then use that to build the C include file with javah.  Finally you compile the C file with the native code.  This is an example from the developer's own system :

 ~~~~~~
 javac JLibJPEG.java
@@ -38,7 +38,20 @@

 The resulting JAR and shared library files need to be on your application's classpath to use them, of course.

-A test file is also available 
+A test java file is also available 
+
+
+Under The Hood
+---------------
+
+JLibJPEG uses standard Java and C calls and invokes only one library - libjpeg.  That's a standard library on Linux systems and available for most systems, including MS Windows.  Most systems use the libjpeg-turbo fork in practice.
+
+JLibJPEG exploits the fact that both libjpeg and Java's BUfferedImage class support the image format 3BYTE_BGR ( i.e. each pixel being three bytes in the order Blue, Green, Red ).  Of course monochrome images are just bytes and this is also supported by BufferedImage.
+
+The C code allows direct access to the libjpeg decoder.
+
+Note that the Java VM has one frustration that cannot easily be avoided.  To pass the decoded JPEG data to Java we must use a byte array.  To safely allocate this and not risk issues with the JVM we unfortunately need to allocate the byte array through Java and Java will always ( and unavoidably ) zero every single byte when we allocate.  There is no safe way around this ( although there is at least one very unsafe way around it ).  This means that we're first zeroing every byte in our multi-megapixel image array and immediately writing over all those zeros when we decode the JPEG.  Unless the Java VM is extended to add support for non-zering allocations at some point in the future, we're stuck with this waste of time.  Despite this, JLibJPEG can still provide a considerable increase in load times, especially when coupled with libjpeg-turbo ( the Linux default ).
+

 [[members limit=20]]
 [[download_button]]
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">StephenG</dc:creator><pubDate>Thu, 28 Nov 2013 15:30:35 -0000</pubDate><guid>https://sourceforge.net572f9366a3db89963d46aa85f253a899b8c8b7ab</guid></item><item><title>Home modified by StephenG</title><link>https://sourceforge.net/p/jlibjpeg/wiki/Home/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v1
+++ v2
@@ -1,8 +1,44 @@
-Welcome to your wiki!
+JLibJPEG is a small Java class interfacing to C code using JNI.  Ut is designed to load large JPEGs as quickly as possible.

-This is the default page, edit it as you see fit. To add a new page simply reference it within brackets, e.g.: [SamplePage].
+JPEG images are a major, perhaps *the* major, image file type used in applications.  Java's standard methods for loadig a JPEG to a BufferedImage are very slow.  This is particularl;y frsutrating if you want to develop applications that view the large image files from modern cameras.  JLibJPEG tries to address this by providing an explicit call to load JPEGs.

-The wiki uses [Markdown](/p/jlibjpeg/wiki/markdown_syntax/) syntax.
+JLibJPEG should work with both RGB and B&amp;amp;W images - it has been tested with both.
+
+Performance tests on the developer's system using an AMD A8 APU indicate a speedup of up to a factor of ten over ImageIO for a 16Mp JPEG straight from a digital camera.  The smaller the image, the less the gain.  In practical terms this made the difference between a photo viewer application that could flip between images ona key stroke and one that had serious lag when images were switched.
+
+
+Using JLibJPEG
+----------------
+
+Using JLIbJPEG is very simple - it's just one call to a static method.  For example ;
+
+~~~~~~
+BufferedImage bi = JLibJPEG.loadImage( "location/name.jpg" ) ;
+~~~~~~
+
+
+The loadImage() method returns *null* if the load operation fails for any reason.  **No** exceptions should be thrown.
+
+
+Building JLibJPEG
+------------------
+
+To build JLibJPEG you first need to compile the Java file and then use that to build the C include file with javah.  Finally you compile the C file with the native code.  THis is an example from teh developer's own system :
+
+~~~~~~
+javac JLibJPEG.java
+
+javah -jni JLibJPEG
+
+jar cf JLibJPEG.jar *.class
+
+gcc -g -shared -fPIC -I/usr/lib/jvm/java-7-openjdk-amd64/include -o libJLibJPEG.so JLibJPEG.c -ljpeg
+~~~~~~
+
+
+The resulting JAR and shared library files need to be on your application's classpath to use them, of course.
+
+A test file is also available 

 [[members limit=20]]
 [[download_button]]
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">StephenG</dc:creator><pubDate>Thu, 28 Nov 2013 15:13:03 -0000</pubDate><guid>https://sourceforge.net9611c992505dc104a4ead6148fa1804c941b46c2</guid></item><item><title>Home modified by StephenG</title><link>https://sourceforge.net/p/jlibjpeg/wiki/Home/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;Welcome to your wiki!&lt;/p&gt;
&lt;p&gt;This is the default page, edit it as you see fit. To add a new page simply reference it within brackets, e.g.: &lt;span&gt;[SamplePage]&lt;/span&gt;.&lt;/p&gt;
&lt;p&gt;The wiki uses &lt;a class="" href="/p/jlibjpeg/wiki/markdown_syntax/"&gt;Markdown&lt;/a&gt; syntax.&lt;/p&gt;
&lt;p&gt;&lt;h6&gt;Project Members:&lt;/h6&gt;
&lt;ul class="md-users-list"&gt;
&lt;li&gt;&lt;a href="/u/sjgdit/"&gt;StephenG&lt;/a&gt; (admin)&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;/p&gt;&lt;p&gt;&lt;span class="download-button-5295e4a1c4d104393ee50c5e" style="margin-bottom: 1em; display: block;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">StephenG</dc:creator><pubDate>Wed, 27 Nov 2013 12:25:06 -0000</pubDate><guid>https://sourceforge.netc280c5a7817dd5d6bcbaa3bd4ae845af2f25975d</guid></item></channel></rss>