diff --git a/lab3/app/Main.hs b/lab3/app/Main.hs index bf692a5..5c45c6c 100644 --- a/lab3/app/Main.hs +++ b/lab3/app/Main.hs @@ -1,5 +1,6 @@ module Main (main) where +import Codec.Picture import Lib caesarShift :: Int @@ -18,4 +19,12 @@ main = do let encryptedTextFromBits = bitsToText encryptedTextBits putStrLn $ take 30 encryptedTextFromBits let decryptedText = decryptCaesar alphabet caesarShift encryptedTextFromBits - putStrLn $ take 30 decryptedText \ No newline at end of file + putStrLn $ take 30 decryptedText + + readImageResult <- readImage "resources/david.bmp" + case readImageResult of + Left err -> putStrLn $ "Ошибка при чтении изображения: " ++ err + Right dynImg -> do + let img = convertRGB8 dynImg + putStrLn $ "Ширина: " ++ show (imageWidth img) + putStrLn $ "Высота: " ++ show (imageHeight img) \ No newline at end of file diff --git a/lab3/lab3.cabal b/lab3/lab3.cabal index 4fc575b..d0ffb76 100644 --- a/lab3/lab3.cabal +++ b/lab3/lab3.cabal @@ -34,7 +34,8 @@ library src ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wincomplete-uni-patterns -Wmissing-export-lists -Wmissing-home-modules -Wpartial-fields -Wredundant-constraints build-depends: - base >=4.7 && <5 + JuicyPixels + , base >=4.7 && <5 default-language: Haskell2010 executable lab3-exe @@ -47,7 +48,8 @@ executable lab3-exe app ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wincomplete-uni-patterns -Wmissing-export-lists -Wmissing-home-modules -Wpartial-fields -Wredundant-constraints -threaded -rtsopts -with-rtsopts=-N build-depends: - base >=4.7 && <5 + JuicyPixels + , base >=4.7 && <5 , lab3 default-language: Haskell2010 @@ -62,6 +64,7 @@ test-suite lab3-test test ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wincomplete-uni-patterns -Wmissing-export-lists -Wmissing-home-modules -Wpartial-fields -Wredundant-constraints -threaded -rtsopts -with-rtsopts=-N build-depends: - base >=4.7 && <5 + JuicyPixels + , base >=4.7 && <5 , lab3 default-language: Haskell2010 diff --git a/lab3/package.yaml b/lab3/package.yaml index 0505b24..ea1a099 100644 --- a/lab3/package.yaml +++ b/lab3/package.yaml @@ -21,6 +21,7 @@ description: Please see the README on GitHub at = 4.7 && < 5 +- JuicyPixels ghc-options: - -Wall