image handler to itextshart.text.image
Using iTextSharp, I can get a normal image (http://www.domain.com/name.jpg) added fine but if I create a generic handler to re-size a image and add a watermark it doesn't seem to work. Here is what I am doing:
Code:
Dim sFullImgUrl As String = "http://www.domain.com/ThumbnailHandler.ashx?id=1234&thumb=yes"
Dim imgItem As iTextSharp.text.Image = iTextSharp.text.Image.GetInstance(New Uri(sFullImgUrl))
This returns 'IOException was unhandled' and says the url is 'not a recognized imageformat'.
Then I tried:
Code:
Dim sFullImgUrl As String = "http://www.domain.com/ThumbnailHandler.ashx?id=1234&thumb=yes"
Using wc As New Net.WebClient
Dim img As System.Drawing.Image = System.Drawing.Image.FromStream(wc.OpenRead(sFullImgUrl))
End Using
This returns 'ArgumentException was unhandled' and says 'Parameter is not valid'.
Any other thoughts on how to use my handler to use with iTextSharp?
Re: image handler to itextshart.text.image
http://www.domain.com/ThumbnailHandl...1234&thumb=yes manifestly is not an image file. The error is therefore exactly what you'd expect. Your url has to point to an actual image file not to a way to get to an image file.
Re: image handler to itextshart.text.image
Is there a way to use the Intelligencia.UrlRewriter.RewriterHttpModule to find a solution?
I tried to add a new rewriter rule in my web.config like so but didn't work as well. Returns with 'The system cannot find the path specified.'
Code:
<rewrite url="~/catalog/images/thumb/(\d+)/default.jpg" to="/ThumbnailHandler.ashx?id=$1&thumb=yes" />
Is this not possible as well?