Skip to content

Gifimage plugin help - #106

Merged
jeremyselan merged 2 commits into
AcademySoftwareFoundation:masterfrom
miti:master
Jun 24, 2011
Merged

Gifimage plugin help#106
jeremyselan merged 2 commits into
AcademySoftwareFoundation:masterfrom
miti:master

Conversation

@miti

@miti miti commented Jun 20, 2011

Copy link
Copy Markdown

I have created the i/o files using gif library installed on ubuntu through the package libgif-dev . But now i am having problem in executing it. I have created all the cmake files according to the gif.imageio but when i try to open a gif file using image viewer it exits without any error message. I even tried converting a jpf file in gif format i am getting segmentation error.

What i have created is not final, m luking for reviews and help in debugging.
Thanks.

@dewyatt

dewyatt commented Jun 20, 2011

Copy link
Copy Markdown

There are a few main issues:

  1. Your repository mainly seems to include *~ files (backup files created by your editor). Something isn't right there, you don't want those files in your repository. For example, rather than "gifinput.cpp~", there should be "gifinput.cpp".
  2. You did not modify src/CMakeLists.txt
  3. You did not modify src/libOpenImageIO/CMakeLists.txt

Just look at how the other plugins do it (jpeg is probably an OK example to go by).
There are some other issues in the actual code but I'll leave that up to others for now as I need to work on my PSD plugin.
Once you modify the CMake files, 'make' will probably fail to build your plugin as there are some issues in the code but that should get you started.

@lgritz

lgritz commented Jun 20, 2011

Copy link
Copy Markdown
Collaborator

I agree with Daniel, to start you need to submit the actual .cpp/.h files, not the editor leftovers ending in ~. Please submit an update that fixes this, then we will be able to build and see how far it gets.

Also, it would be great if you could describe in more detail what you mean by "having problem in executing it." Does it build? Does it clearly build the gif plugin, for example do you see a dist/linux64/lib/gif.imageio.so ? If so, then what exactly happens when you try to "iinfo foo.gif"? Does it crash? Give wrong results? If it crashes, have you done a DEBUG build and tried running in gdb to see where it crashes?

@lgritz

lgritz commented Jun 20, 2011

Copy link
Copy Markdown
Collaborator

Hint: you should 'git rm' the *~ files, and then 'git add' the files you really intended to show us. Then commit and push, and the pull request will automatically update!

Also, I really recommend that you make a separate branch (not master) for such work -- you probably want to keep your master in sync with our master, no?

@miti

miti commented Jun 21, 2011

Copy link
Copy Markdown
Author

Thanks for your reply. I have added .cpp files now you can build it to check.

@lgritz

lgritz commented Jun 21, 2011

Copy link
Copy Markdown
Collaborator

There's still imageioplugin.cpp~, which is not the right file. If you delete this and correctly add imageioplugin.cpp, then we will see the proper diff of exactly what you have changed in imageioplugin.cpp.

Comment thread src/gif.imageio/gifinput.cpp Outdated

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm pretty sure this line is going to be a problem. ImageSpec takes width, height, channels. The channels should, for example, be 3 for an RGB image, 4 for RGBA. Somehow, I have the feeling that GifFile->Image.ColorMap->ColorCount is not the number of channels, but rather the number of distinct colors!

@dewyatt

dewyatt commented Jun 21, 2011

Copy link
Copy Markdown

You'll also need to make the following changes to get it to build:
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 2b15c69..bdefd04 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -139,6 +139,7 @@ if (NOT EMBEDPLUGINS)
add_subdirectory (dpx.imageio)
add_subdirectory (field3d.imageio)
add_subdirectory (fits.imageio)

  • add_subdirectory (gif.imageio)
    add_subdirectory (hdr.imageio)
    add_subdirectory (ico.imageio)
    add_subdirectory (jpeg.imageio)
    diff --git a/src/libOpenImageIO/CMakeLists.txt b/src/libOpenImageIO/CMakeLists.t
    index d16012f..f214eed 100644
    --- a/src/libOpenImageIO/CMakeLists.txt
    +++ b/src/libOpenImageIO/CMakeLists.txt
    @@ -85,6 +85,7 @@ if (EMBEDPLUGINS)
    ../dpx.imageio/libdpx/InStream.cpp ../dpx.imageio/libdpx/DPXColorConv
    ../fits.imageio/fitsinput.cpp ../fits.imageio/fitsoutput.cpp
    ../fits.imageio/fits_pvt.cpp
  •    ../gif.imageio/gifinput.cpp ../gif.imageio/gifoutput.cpp
     ../hdr.imageio/hdrinput.cpp ../hdr.imageio/hdroutput.cpp
       ../hdr.imageio/rgbe.cpp
     ../ico.imageio/icoinput.cpp ../ico.imageio/icooutput.cpp
    
    @@ -125,6 +126,7 @@ if (EMBEDPLUGINS)
    find_package (JPEG REQUIRED)
    find_package (TIFF REQUIRED)
    find_package (ZLIB REQUIRED)
  • find_package (GIF REQUIRED)
    find_package (Jasper)
    include_directories (${PNG_INCLUDE_DIR} ${JPEG_INCLUDE_DIR})
    include_directories (${TIFF_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR})
    @@ -171,6 +173,7 @@ if (EMBEDPLUGINS)
    ${JASPER_LIBRARY}
    ${FIELD3D_LIBRARY}
    ${HDF5_LIBRARIES}
  •                           ${GIF_LIBRARIES}
    

When I ran iinfo on a gif I got a segfault in DGifGetRecordType so there may be other issues.

…mputed

The --hash option is deprecated; the SHA-1 hash is now computed in all cases.
The SHA1 computation was also moved to later in the txmake process, so it also
takes into account upstream image changes, such as resizing. constant color metadata is always emitted (though the image dimenstions are not
shrunk unless explicitly requested, such as with --oiio)
@jeremyselan
jeremyselan merged commit 3f44533 into AcademySoftwareFoundation:master Jun 24, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants