Link to home
Start Free TrialLog in
Avatar of fpkeegan
fpkeegan

asked on

Oracle convert GIF BLOB to JPG BLOB

Oracle 11g release 11.2.0.3

Crystal reports 2011   version 14.0.7.738 RTM

I have a product database that stores GIF images in a BLOB column. Crystal Report does not support GIF images.  I can display JPG BLOB images from an oracle database in Crystal Reports without any problems.  Using only oracle SQL or PL/SQL  how do I convert a GIF BLOG to a JPG BLOB.  

I have search the internet and believe that it can be done, but there is no clear example of how to do it.

Thank you for your help
Paul
Avatar of Sean Stuber
Sean Stuber

while it is probably possible to convert using nothing but pl/sql, it might be easier to create a java stored procedure with a pl/sql interface.

there are already available java classes for doing that


if you really want to do it with just pl/sql, that sounds like an interesting project.  Probably more than you're going to get in a Q&A forum
I concur with above  
Likely the oracle intermedia stuff is what you are looking for
How does the image get loaded/stored in the database?

If you have an application that does it, can you change the application to use one of the many freeware image conversion programs and then store the image to the database?

mlmcc
Avatar of fpkeegan

ASKER

As stated, the data is loaded from a product applacation, so it can not be changed.   Java development is not supported by the Company I work for,  so no Java.

I think it can be done with ORDSYS.ORDImage  or but I not sure how.
ASKER CERTIFIED SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
function convert_JPG (GIF_IMAGE in BLOB)
    return blob
 as
 -- convert the input gif IMAGE type to JPG  
   image ORDSYS.ORDImage;
   l_JPG_IMAGE  BLOB := empty_Blob();

 BEGIN
     
     
    dbms_lob.createTemporary(l_JPG_IMAGE ,false);
       
    image := ORDSYS.ORDImage(GIF_IMAGE,1);
     
    ordsys.ordimage.processCopy(GIF_IMAGE, 'fileformat=jpeg', l_JPG_IMAGE);
   
 
   return  l_JPG_IMAGE;
 End ;
good job...