fedefrappi / AePubReader

Another ePub Reader for iPad
-
369 stars 150 forks source link

How to find the image width and height? #11

Open RenugaDevi opened 12 years ago

RenugaDevi commented 12 years ago

I found another problem that is, i'm using the code

[NSString stringWithFormat:@"addCSSRule('img', 'max-width: %fpx; height: %fpx;')", self.webView.frame.size.width_0.75,self.webView.frame.size.height_0.75]; [webView stringByEvaluatingJavaScriptFromString:setImageRule];

to avoid image getting cut. Now image getting cut problem is solved. But the only problem is, if the image is too small(400*200) means image getting stretch(with that code). Please guide me to solve that.

I'm really struggle with this problem..How can i check the image size based on that i will try to change this code

[NSStringstringWithFormat:@"addCSSRule('img', 'max-width: %fpx; height: %fpx;')", self.webView.frame.size.width_0.75,self.webView.frame.size.height_0.75]; [webViewstringByEvaluatingJavaScriptFromString:setImageRule];

for set webView width and height...

There are different size of images. so only it's getting stretch or shrink when aligning the image to fit in a webview.

Now i need to find image width and height which is used in picture book(.ePub) . Then only i can able to fit the image with original size of image in webview.

Please anyone guide me to do this

Thank you

RenugaDevi commented 12 years ago

Anyone help me to solve my issue. I don't know how and where to start work.

please give me any ideas to find out image width and height which is used in .epub picture book.

I'm expecting your valuable guidance in this regard..

Thank you