From abb078e1b66bb55203fc7b3ca4f93aebcce032ed Mon Sep 17 00:00:00 2001 From: Arity-T Date: Sun, 17 Nov 2024 20:48:05 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A7=D1=82=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=B8?= =?UTF-8?q?=D0=B7=D0=BE=D0=B1=D1=80=D0=B0=D0=B6=D0=B5=D0=BD=D0=B8=D1=8F=20?= =?UTF-8?q?=D1=81=20JuicyPixels?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lab3/app/Main.hs | 11 ++++++++++- lab3/lab3.cabal | 9 ++++++--- lab3/package.yaml | 1 + 3 files changed, 17 insertions(+), 4 deletions(-) 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