Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

deleted references to .h files in code (ignored anywa). changed refer…

…ence to libpng version and added note.
  • Loading branch information...
commit 43fc177abe982b4e217691f24fbb92236a539835 1 parent 4bfb478
@timsears authored
View
BIN  Spectrum.png
Deleted file not rendered
View
BIN  Water-small.png
Deleted file not rendered
View
BIN  Water.png
Deleted file not rendered
View
2  libpng.cabal
@@ -29,7 +29,7 @@ library
hs-source-dirs: src
extra-libraries: png
build-depends: base >= 4.2 && < 5
- ghc-options: -Wall -O2
+ ghc-options: -Wall -O2
if flag(threaded)
ghc-options: -threaded
View
37 src/Codec/Image/LibPNG.hs
@@ -93,8 +93,9 @@ pixelssFromImage image = mapM ( pixelsFromRow width ) rows where
width = widthImage image
rows = rowsImage image
+-- | EDIT THIS TO REFLECT THE VERSION OF libpng THAT YOU HAVE!
c_PNG_LIBPNG_VER_STRING :: CString
-c_PNG_LIBPNG_VER_STRING = unsafePerformIO $ newCString "1.2.44"
+c_PNG_LIBPNG_VER_STRING = unsafePerformIO $ newCString "1.5.8"
c_PNG_INTERLACE_NONE :: Int
c_PNG_INTERLACE_NONE = 0
@@ -111,17 +112,17 @@ c_PNG_COLOR_TYPE_RGB = 2
c_PNG_FILLER_AFTER :: Int
c_PNG_FILLER_AFTER = 1
-foreign import ccall "png.h png_create_read_struct"
+foreign import ccall "png_create_read_struct"
c_png_create_read_struct :: CString -> Ptr () -> Ptr () -> Ptr ()
-> IO PNG
-foreign import ccall "png.h png_create_write_struct"
+foreign import ccall "png_create_write_struct"
c_png_create_write_struct :: CString -> Ptr () -> Ptr () -> Ptr ()
-> IO PNG
type CFile = Ptr ()
-foreign import ccall "png.h png_init_io"
+foreign import ccall "png_init_io"
c_png_init_io :: PNG -> CFile -> IO ()
foreign import ccall "stdio.h fopen"
@@ -132,52 +133,52 @@ foreign import ccall "stdio.h fclose"
type PNGInfo = Ptr ()
-foreign import ccall "png.h png_create_info_struct"
+foreign import ccall "png_create_info_struct"
c_png_create_info_struct :: PNG -> IO PNGInfo
-foreign import ccall "png.h png_set_IHDR"
+foreign import ccall "png_set_IHDR"
c_png_set_IHDR :: PNG -> PNGInfo -> Word -> Word
-> Int -> Int -> Int -> Int -> Int
-> IO ()
-foreign import ccall "png.h png_get_IHDR"
+foreign import ccall "png_get_IHDR"
c_png_get_IHDR :: PNG -> PNGInfo -> Ptr Word -> Ptr Word
-> Ptr Int -> Ptr Int -> Ptr Int -> Ptr Int -> Ptr Int
-> IO ()
-foreign import ccall "png.h png_write_info"
+foreign import ccall "png_write_info"
c_png_write_info :: PNG -> PNGInfo -> IO ()
-foreign import ccall "png.h png_read_info"
+foreign import ccall "png_read_info"
c_png_read_info :: PNG -> PNGInfo -> IO ()
-foreign import ccall "png.h png_read_update_info"
+foreign import ccall "png_read_update_info"
c_png_read_update_info :: PNG -> PNGInfo -> IO ()
-foreign import ccall "png.h png_get_image_width"
+foreign import ccall "png_get_image_width"
c_png_get_image_width :: PNG -> PNGInfo -> IO Word
-foreign import ccall "png.h png_get_image_height"
+foreign import ccall "png_get_image_height"
c_png_get_image_height :: PNG -> PNGInfo -> IO Word
-foreign import ccall "png.h png_get_color_type"
+foreign import ccall "png_get_color_type"
c_png_get_color_type :: PNG -> PNGInfo -> IO Word8
-foreign import ccall "png.h png_set_filler"
+foreign import ccall "png_set_filler"
c_png_set_filler :: PNG -> Word -> Int -> IO ()
type RowPtrPointer = Ptr (Ptr Word8)
-foreign import ccall "png.h png_write_image"
+foreign import ccall "png_write_image"
c_png_write_image :: PNG -> RowPtrPointer -> IO ()
-foreign import ccall "png.h png_read_image"
+foreign import ccall "png_read_image"
c_png_read_image :: PNG -> RowPtrPointer -> IO ()
-foreign import ccall "png.h png_read_end"
+foreign import ccall "png_read_end"
c_png_read_end :: PNG -> Ptr () -> IO ()
-foreign import ccall "png.h png_write_end"
+foreign import ccall "png_write_end"
c_png_write_end :: PNG -> Ptr () -> IO ()
withForeignPtrs :: [ForeignPtr a] -> ([Ptr a] -> IO b) -> IO b
Please sign in to comment.
Something went wrong with that request. Please try again.