added export of 'hImageRows' and 'hImageColumns' to Images #2

Merged
merged 1 commit into from Sep 8, 2011

Projects

None yet

2 participants

@alios
Contributor
alios commented Aug 28, 2011

Hi!

Because I need the images resolution I added export of 'hImageRows' and 'hImageColumns' to Images.
Feel free to pull it in your tree.

Regards
Markus

@vincentg
Owner
vincentg commented Sep 8, 2011

Hi,

Sure I'm pulling it, those two exports cost little and add user-friendlyness.

FYI, getting image resolution was possible before by extracting the image info like in this snippet:

    calcReductionFactors :: HImage -- ^ The image 
                                                -> IO [Dimension] 
    calcReductionFactors himg =
      withForeignPtr (getImage himg) $ \p -> do
        img <- peek p
        return $ computeFactors (columns img) (rows img)

(was little bit painful to extract the Ptr from the foreignPtr to get this basic info)

Thanks for this addition, it will be in the next hsmagick release

Vincent

@vincentg vincentg merged commit 5f52d82 into vincentg:master Sep 8, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment