Solved

BlobStream convert to JPEG using ImageLib

Posted on 2009-05-05
8
788 Views
Last Modified: 2012-05-06
I have images stored in a table, they may or may not be Bitmap, we do not have the extension stored in the table.
I need to convert every image in the table to JPEG using the ImageLib suite.

Anyone have any code showing how to do this?
0
Comment
Question by:EddieShipman
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
8 Comments
 
LVL 14

Expert Comment

by:SteveBay
ID: 24311071
Hmm. There is a strikingly similar Q posted in the imagelib_corperate_suite NG;) Don't hold your breath waiting for an answer over there.

I know it's not meant to work on streams.. but you could try saving the blob to a file and then use TPMultiImage.GetInfoAndType function. Then check the value of TPMultiImage.BFileType. I've never tried it but the help file description suggests that it might be what you are looking for
0
 
LVL 26

Author Comment

by:EddieShipman
ID: 24314227
I really didn't want to save it to a file, first. Can I not load the TPMultiImage from a stream and then use the GetInfoAndType function to determine the graphic class I need to create?
0
 
LVL 26

Author Comment

by:EddieShipman
ID: 24314233
Yes, it is the same, it was posted with my boss' account.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 14

Expert Comment

by:SteveBay
ID: 24314300
I have some ideas but no time to test them right now. Stay tuned.
0
 
LVL 14

Accepted Solution

by:
SteveBay earned 500 total points
ID: 24314391
This is something I tried late last night and it seems to be able to tell the difference between Bimaps and JPEG. I got results like this:

FImageType JPEG, Fwidth 270, FHeight 180, Fbitspixel 24,  Fnumcolors 0, Fcompression RGB
FImageType BMP, Fwidth 270, FHeight 180, Fbitspixel 24,  Fnumcolors 0, Fcompression None




Uses DLL96V1
//....
procedure TForm1.Button1Click(Sender: TObject);
var ms : TMemoryStream;
     FImageType : String;
     Fwidth        : SmallInt;
     FHeight       : SmallInt;
     Fbitspixel    : SmallInt;
     Fplanes       : SmallInt;
     Fnumcolors    : SmallInt;
     Fcompression : String;
begin
     Memo1.Clear;
     Table1.Active := True;
     Table1.First;
 
     ms := TMemoryStream.Create;
 
     while not Table1.Eof do
          begin
          ms.Clear;
          TBlobField(Table1.FieldByName('Data')).SaveToStream(ms);
          ms.Position := 0;
          GetBlobInfo(ms.Memory,
                      ms.Size,
                      FImageType,
                      Fwidth,
                      FHeight,
                      Fbitspixel,
                      Fplanes,
                      Fnumcolors,
                      Fcompression );
          Memo1.Lines.Add(Format('FImageType %s, Fwidth %d, FHeight %d, Fbitspixel %d,  Fnumcolors %d, Fcompression %s',
                              [ FImageType , Fwidth , FHeight , Fbitspixel ,  Fnumcolors , Fcompression]));
 
 
          Table1.Next;
          end;
     ms.Free;
end;

Open in new window

0
 
LVL 26

Author Comment

by:EddieShipman
ID: 24317427
ok, I will give it a try and see if it is what I need.
DLL96V1 is an ImageLib unit, correct?
0
 
LVL 14

Expert Comment

by:SteveBay
ID: 24317828
It sure is.
I find it in C:\Program Files\SkyLine\ImageLib7\Vcl_Del7 on my system.
0
 
LVL 26

Author Closing Comment

by:EddieShipman
ID: 31578231
Looks great and it works, Thanks.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Run video youtube webbrowse 10 85
URL for downloading Google Chrome for Win XP 2 271
Tidtcpserver listening on multiports? 1 53
Firemonkey Queue list 1 50
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question