ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 WIC Failure when save to JPEG

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
foxdingding Posted - Mar 03 2022 : 01:44:51


IEN 10.3
Delphi11
64Bit


procedure TForm3.Button1Click(Sender: TObject);
begin
  ImageEnView2.IO.Params.TIFF_Compression:=TIOTIFFCompression.ioTIFF_LZW;
  ImageEnView2.IO.SaveToFiletiff(sFileName+'_LZW_.tif');
   ShowMessage('Save OK!');
end;

procedure TForm3.Button2Click(Sender: TObject);
begin
  ImageEnView2.IO.Params.TIFF_Compression:=TIOTIFFCompression.ioTIFF_Jpeg;
  ImageEnView2.IO.SaveToFiletiff(sFileName+'_JPEG_.tif');
end;

procedure TForm3.Button3Click(Sender: TObject);
begin
  ImageEnView2.IO.SaveToFileJpeg(sFileName+'.jpg');
end;

procedure TForm3.Button4Click(Sender: TObject);
begin
  ImageEnView2.IO.SaveToFilePNG(sFileName+'.png');
end;


procedure IEJoinBitmaps_1(Dest: TIEBitmap;
                              Src: TIEBitmap;
                              Vertical: Boolean;
                              BGColor: TColor = clBlack);
var
   imgLeft, imgTop: Integer;
   totalWidth,totalHeight:Integer;
   tmpI:Integer;
begin
   if Vertical then//#22402;#30452;#30340;
   begin
      totalWidth :=Src.Width;
      totalHeight:=Src.Height*100;
   end
   Else
   Begin
      totalWidth :=Src.Width*100;
      totalHeight:=Src.Height;
   End;

   if totalWidth<=0 then Exit;
   if totalHeight<=0 then Exit;

   Dest.IEInitialize( totalWidth, totalHeight, BGColor );

   imgTop :=0;
   imgLeft:=0;

   for tmpI := 0  to 99 do
   Begin
     if Vertical then
     begin
       imgLeft := ( totalWidth - Src.Width ) div 2;

       Src.DrawToTIEBitmap( Dest, imgLeft, imgTop );
       Inc(imgTop,Src.Height);
     end
     else
     begin
       imgTop  := ( totalHeight - Src.Height ) div 2;

       Src.DrawToTIEBitmap( Dest, imgLeft, imgTop );
       Inc(imgLeft,Src.Width);
     end;
   End;
end;


procedure TForm3.Button5Click(Sender: TObject);
Var
   tmpIEBitmap:TIEBitmap;
begin
   tmpIEBitmap:=Self.ImageEnView1.IEBitmap;

   tmpIEBitmap.IEInitialize( 10*300, 10*300, clWhite );

   tmpIEBitmap.Canvas.Pen.Color:=clRed;
   tmpIEBitmap.Canvas.Pen.Width:=20;
   tmpIEBitmap.Canvas.LineTo(0,0);
   tmpIEBitmap.Canvas.LineTo( tmpIEBitmap.width,tmpIEBitmap.height);

   tmpIEBitmap.Canvas.Pen.Color:=clGreen;
   tmpIEBitmap.Canvas.Pen.Width:=20;
   tmpIEBitmap.Canvas.LineTo(tmpIEBitmap.width,0);
   tmpIEBitmap.Canvas.LineTo( 0,tmpIEBitmap.height);

   ImageEnView1.Update;
   ImageEnView1.Fit();


   IEJoinBitmaps_1(Self.ImageEnView2.IEBitmap,
                        ImageEnView1.IEBitmap,
                        TRUE,clWhite);

   ImageEnView2.Update;
   ImageEnView2.FitToWidth;

   Self.Caption:=ImageEnView2.IEBitmap_Width.ToString
      +' '+ImageEnView2.IEBitmap_Height.ToString;
end;

procedure TForm3.FormCreate(Sender: TObject);
begin
   sFileName:='C:\123';
end;














attach/foxdingding/20223314747_SaveBug.zip
91.78 KB
1   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Mar 03 2022 : 22:43:16
Hi

Firstly, please add ielib64.dll to your EXE folder:

https://www.imageen.com/help/ImageEn_DLLs.html

Otherwise it falls back to using WIC for JPEG and PNG handling.


However you may still have some issues saving an image of 3,000 x 300,000. The odd shape with almost a billion mega-pixels seems to trip up the JPEG library.

A more standard shape with over a billion mega-pixels (40,000 x 40,000) works without error.




Nigel
Xequte Software
www.imageen.com