-1

please I need help to Convert Oracle Blob with tiff file format to Blob with jpg or png file Format Oracle 19c

I tried oracle PLSQL function but the error below rise up

FUNCTION convert_JPG (IMAGE in BLOB)
    return blob
 as
   l_JPG_IMAGE  BLOB ;
 BEGIN

   ORDSYS.ORD_IMAGE.processCopy(IMAGE,'fileFormat=JFIF',l_JPG_IMAGE);
   return  l_JPG_IMAGE;
 End ; 

This is the error stack

ORA-06510: PL/SQL: unhandled user-defined exception ORA-06512: at 
"ORDSYS.ORDIMAGE", line 456 ORA-06512: at "ORDSYS.ORD_IMAGE", line 330 ORA- 
06512: at "CONVERT_JPG", line 7
Mohammad
  • 739
  • 7
  • 22

2 Answers2

2

ORDSYS.ORD_IMAGE is part of Oracle Multimedia, which was removed in Oracle 19c. Therefore there is no straightforward solution in PL/SQL. If you know Java the answer above is probably the easiest solution.

Source: Convert blob image to PUBLIC.ORDIMAGE in plsql

0
  1. Write a Java program to convert TIFF to another format.
  2. Use a CREATE JAVA statement to load that program into the database.
  3. Create a PL/SQL function to wrap the Java function.
  4. Call that function from PL/SQL.

A similar example which shows how to read a BLOB, process it (in this case unzip it rather than image processing) and then return the output as a BLOB is this answer.

MT0
  • 143,790
  • 11
  • 59
  • 117