Image height is too large

Hi,

I am attempting to execute the following code:

--------------------------------------------------------------------------------------

Dim pdf As pdf = New pdf()

Dim section As section = New section(Pdf)
pdf.Sections.Add(section)

Dim image2 As Aspose.Pdf.Image = New Aspose.Pdf.Image(section)
section.Paragraphs.Add(image2)

image2.ImageInfo.File = “d:\inetpub\www-dev\Bag11083.TIF”
image2.ImageInfo.ImageFileType = ImageFileType.Tiff
'image2.ImageWidth = 2560
'image2.ImageHeight = 1779

pdf.Save(Response)
Response.End()

--------------------------------------------------------------------------------------

This results in the following error :

--------------------------------------------------------------------------------------
Image height is too large1779

Stack Trace:

[ApplicationException: Image height is too large1779]
Aspose.Pdf.Xml.Q7.ProcessImage(Pdf doc, Section currentPart, Table table, Row row, Cell cell, Image image, AssignInfo assignInfo, X7 useType, Boolean isFirst) +4920
Aspose.Pdf.Xml.c7.ProcessSection(Pdf doc, Section section, AssignInfo assignInfo) +994
Aspose.Pdf.Xml.H7.AssignPages(Pdf doc) +308
Aspose.Pdf.Xml.J7.GenerateDocument(G6 gen, Pdf doc) +26
Aspose.Pdf.Pdf.Save(HttpResponse response) +45
asposeTest.Page_Load(Object sender, EventArgs e) in W:\www-dev\DesktopModules\Test\asposeTest.aspx.vb:57
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +731

--------------------------------------------------------------------------------------


Our image is saved in ccitt format, however, for testing purposes we are attempting to use both the ImageFileType = Ccitt and ImageFileType = Tiff. Both file types result in the same error message, however, the ccitt type requires the imagewidth and imageheight property to be set.

Could you please provide some assistance as to the cause of this error. Perhaps the ccitt file type has a hardcoded maximum file height/width?

Additionally, due to the nonexistant support of ccitt images by acrobat reader, there must be some kind of file conversion being done by aspose.pdf internally in order to allow a source image of type ccitt to be viewed by acrobat. Is this a true statement? Is there any internal conversion of ccitt files being done by aspose.pdf?

Thank you for your assistance.
Brendan Ingram

Dear Brendan,

Tommy will answer the questions you have asked later.

Please provide sample image files which will reproduce the bug and email them to pdf@aspose.com? Include the link for this post for easier reference.

Dear brendaningram,

Thanks for your consideration.

Would you please send your code and image to me? I will test it and reply to you soon.

Tommy,

He has sent the files to pdf@aspose.com. Please check it.

I have a different problem with images.

[XML File]



[VisualBasic]

Dim logoPara As Paragraph
logoPara = section1.Paragraphs(“Logo”)
Dim logoImage As Aspose.Pdf.Image
logoImage = CType(logoPara, Image)
logoImage.ImageInfo.File = path + “\photos\” & Tourney.tournid & “.jpg”
logoImage.ImageHeight = 100


Setting the ImageHeight and Width properties seem to have no affect. Only the ImageScale property seems to have any affect and it doesn’t help resolve teh problem since ImageHeight and ImageWidth return 0 when I try to determine the size of the image.

Dear brendaningram,

Thanks for your consideration.


There is really a bug about CCITT image. We need time to fix it. Since your image can display in tif format, you can set image type to tiff instead of ccitt.

Dear nbtb,

Thanks for your consideration.

ImageHeight and Width properties have no affect on the displaying of image. You can only use ImageScale property to do this. ImageHeight and Width properties should only be used when using CCITT image or image on the web.


Yes, I agree this is a bug with ccitt. However, we cannot use image type = tiff, as this results in a pdf of approximately 1mb. Our original ccitt image is 49k - resulting pdf (with image type = ccitt) should only be 54k. A pdf of 1mb+ (when using image type = tiff) is not acceptable for our application. We really need ccitt image type to be working.



Do you have any idea of the cause of the ccitt issue?

Brendan

Dear Brendan,

Yeah it’s serious for you to convert ccitt to tiff.

But could you tell me how many days you can offer Tommy to fix this bug so you can launch your product in time?

Dear brendaningram,

Thanks for your consideration.

I have tested your 49k Bag11083_X.tif with Type=“tiff” and it works well. Your can use tiff type currently, I need time to fix the ccitt bug.

We are wanting to expose the transport proof of delivery interface to clients at the end of next week.

would like to test before that though

Patrick