Saving JP2 images

After four days of dealing with continous errors in save routine for jp2 files, I finally got something fruitful. Initially I was getting errors from glibc which was giving me trouble using malloc(). Turns out I had not freed some memory and doing that fixed that error. Then came a run-time seg fault which was annoying. It took me a while to notice that in a for loop I had for(k =0;i< comps;i++) whereas it should have been for(k=0;k<comps;k++). i was uninitialized so the program basically skipped the step and a opj_create_image routine did not get the proper values.

After finding these stupid errors came the errors from the openjpeg library. Finding this error made me understand how the library is written, so it may have been a blessing in disguise! The problem was in writing header data into a stream. After a lot of debugging, I noticed the actual problem was initializing the data buffer in the stream. This led me to realize that I was actually not setting the width and height in the openjpeg image data structure. I assumed this done during initializing because I provided this data for each individual component. After doing this the program ran smoothly and saved the image. But now the problem was that the saved image was all black. The reason was some uinitialized values in the compression parameters. After figuring out the right values the image was finally saved correctly.

There are still some improvement that are needed though. First I need an interactive way of changing paramters for compression. Secondly, I need to test it with some standard images provided on the openjpeg discussion forum. That should complete this plugin. I would need to work a little harder to complete all this within two days as I have until August 21 to do this work.

I also need to make changes in the inverse halftoning plugin to put a graphical interface so that halftoned images of various frequencies can be reversed. The denoising plugin I believe is complete and works well.

After all this I need to make sure I have proper copyrights in the files and also write a final report.  Hopefully things will be done in time.

13 Responses to “Saving JP2 images”

  1. Simon Says:

    “valgrind” is a great tool to spot places where you use uninitialized memory. It also helps with free/malloc problems. Have a look at devel-docs/debug-plug-ins.txt in the gimp sources to get an idea how to invoke it.

    (It will show you some errors you can do nothing about, especially when your plugin starts up, you need to carefully look at them and try to figure out if they are in GTK/X11/libc, so that they are not in your code)

    Hope this helps,
    Simon

  2. Roo Says:

    Is the plugin available for download?

  3. Pucelo Says:

    Yes, but it hasn’t been compiled for Windows, Mac or Linux:
    http://registry.gimp.org/plugin?id=8629

    When it has been compiled, We will can say that GIMP can save JPEG 2000 format.

  4. pucelo Says:

    I have compiled it for Windows,
    In this link you have five plugins that they aren’t in normal GIMP distribution.
    http://www.megaupload.com/?d=9S9VMR19

  5. Roo Says:

    Thanks to all these who’ve contributed.

    Has anyone compiled it for Linux? It would be really appreciated.

  6. Yivmodwy Says:

    real beauty page cp lolita
    588

  7. Tnsouauh Says:

    The United States Extreme Nymphets %-OOO

  8. Viqxlqnf Says:

    Looking for work Nymphet Cartoons tkwzuj

  9. Keedjgla Says:

    Will I have to work on Saturdays? Preteen Bbs List :PP

  10. Nkgpjoul Says:

    I can’t get through at the moment Amateur Teen Modell
    8-OO

  11. Iffmfhmo Says:

    A financial advisor http://uhedarodeta.de.tl littles girl how the fuck did that guy last so long!! i would of came extra fast if i was fucking her

  12. Johnk136 Says:

    Appreciating the time and energy you put into your blog and in depth information you provide. It’s good to come across a blog every once in a while that isn’t the same unwanted rehashed information. Excellent read! I’ve saved your site and I’m adding your RSS feeds to my Google account. ebeddkdgcedb

  13. pacedavid21838 Says:

    I found my webbing spray in a rubber stamping store in my area. I have also seen it in Michael’s in the section where they sell spray paint. Like all Click https://twitter.com/moooker1

Leave a reply to Roo Cancel reply