Solved

BlobStream convert to JPEG using ImageLib

Posted on 2009-05-05
8
795 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
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!

 
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

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses
Course of the Month11 days, 9 hours left to enroll

623 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