英文:
How to convert Oracle Blob with tiff file format to Blob with jpeg file Format
问题
请帮我将 Oracle 中的 TIFF 文件格式的 Blob 转换为 JPG 或 PNG 文件格式的 Blob
Oracle 19c 
我尝试了 Oracle PLSQL 函数,但是出现了下面的错误
    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 ; 
这是错误堆栈 
    ORA-06510: PL/SQL: 未处理的用户定义异常 ORA-06512: 在 
    "ORDSYS.ORDIMAGE",第456行 ORA-06512: 在 "ORDSYS.ORD_IMAGE",第330行 ORA- 
    06512: 在 "CONVERT_JPG",第7行
英文:
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
答案1
得分: 2
ORDSYS.ORD_IMAGE是Oracle多媒体的一部分,已在Oracle 19c中被移除。因此,在PL/SQL中没有直接的解决方案。如果您了解Java,上述答案可能是最简单的解决方案。
英文:
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:
https://stackoverflow.com/questions/57494349/convert-blob-image-to-public-ordimage-in-plsql
答案2
得分: 0
- 编写一个Java程序来将TIFF转换为另一种格式。
 - 使用
CREATE JAVA语句将该程序加载到数据库中。 - 创建一个PL/SQL函数来包装这个Java函数。
 - 从PL/SQL中调用该函数。
 
一个类似的示例展示了如何读取BLOB,对其进行处理(在这种情况下是解压而不是图像处理),然后将输出作为BLOB在这个答案中。
英文:
- Write a Java program to convert TIFF to another format.
 - Use a 
CREATE JAVAstatement to load that program into the database. - Create a PL/SQL function to wrap the Java function.
 - 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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。


评论