I am using ReportBuilder Enterprise 22.06 in Delphi 12.2. The ppDBImage component in the GraphicType property does not yet have the "WebP" format.
I have WebP images saved in a MySQL database, and to display them in a report I am only able to load them in a ppImage in the OnPrint event:
procedure TForm1.ppImage1Print(Sender: TObject); var st_ArquivoImage: TStream; begin
if not qryRelatorio.FieldByName('Imagem').IsNull then begin st_ArquivoImage := qryRelatorio.CreateBlobStream( qryRelatorio.FieldByName('Imagem'), bmRead ); ppImage1.Picture.LoadFromStream( st_ArquivoImage ); st_ArquivoImage.DisposeOf; end;
Although the WebP format has been in use for several years, native support for it has only recently been integrated into Delphi's latest version through the Skia library, making it a new feature for us. We will consider adding WebP support for the DBImage component in a future release of ReportBuilder.
In the meantime, you can manually load a WebP image from data into a report using the TppImage component or the OnGetPicture event of the TppDBImage.
Comments
ReportBuilder leverages Delphi's excellent image architecture
Delphi supports extending image support via registering TGraphic descendants. Examples are TJPEGImage and TPngImage.
Perhaps you can find a third party TGraphic descendant that supports WebP.
The other solution is to convert the WebP images to Png or Jpeg for use in Delphi and RB Image classes. Might be a 3rd party library that can do that.
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
PS Sorry for slow reply.
Even the latest version of ReportBuilder doesn't support the WebP image format?
This format has been widely used for years. It is Google's standard. WebP is far superior to JPEG and PNG.
https://developers.google.com/speed/webp?hl=pt-br
I am using ReportBuilder Enterprise 22.06 in Delphi 12.2. The ppDBImage component in the GraphicType property does not yet have the "WebP" format.
I have WebP images saved in a MySQL database, and to display them in a report I am only able to load them in a ppImage in the OnPrint event:
procedure TForm1.ppImage1Print(Sender: TObject);
var
st_ArquivoImage: TStream;
begin
if not qryRelatorio.FieldByName('Imagem').IsNull then
begin
st_ArquivoImage := qryRelatorio.CreateBlobStream( qryRelatorio.FieldByName('Imagem'), bmRead );
ppImage1.Picture.LoadFromStream( st_ArquivoImage );
st_ArquivoImage.DisposeOf;
end;
end;
Thank you for your attention!
Although the WebP format has been in use for several years, native support for it has only recently been integrated into Delphi's latest version through the Skia library, making it a new feature for us. We will consider adding WebP support for the DBImage component in a future release of ReportBuilder.
In the meantime, you can manually load a WebP image from data into a report using the TppImage component or the OnGetPicture event of the TppDBImage.
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com