简体   繁体   English

如何将 tiff 文件格式的 Oracle Blob 转换为 jpeg 文件格式的 Blob

[英]How to convert Oracle Blob with tiff file format to Blob with jpeg file Format

please I need help to Convert Oracle Blob with tiff file format to Blob with jpg or png file Format Oracle 19c请我需要帮助将 tiff 文件格式的 Oracle Blob 转换为 jpg 或 png 文件格式的 Blob 格式 Oracle 19c

I tried oracle PLSQL function but the error below rise up我试过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 ; 

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. Write a Java program to convert TIFF to another format .编写一个 Java 程序将 TIFF 转换为另一种格式
  2. Use a CREATE JAVA statement to load that program into the database.使用CREATE JAVA语句将该程序加载到数据库中。
  3. Create a PL/SQL function to wrap the Java function.创建一个 PL/SQL 函数来包装 Java 函数。
  4. Call that function from PL/SQL.从 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 .一个类似的例子展示了如何读取BLOB ,处理它(在这种情况下是解压它而不是图像处理),然后将输出作为BLOB返回是这个答案

ORDSYS.ORD_IMAGE is part of Oracle Multimedia , which was removed in Oracle 19c . ORDSYS.ORD_IMAGE 是Oracle Multimedia 的一部分,在 Oracle 19c 中删除 Therefore there is no straightforward solution in PL/SQL.因此在 PL/SQL 中没有直接的解决方案。 If you know Java the answer above is probably the easiest solution.如果您了解 Java,那么上面的答案可能是最简单的解决方案。

Source: Convert blob image to PUBLIC.ORDIMAGE in plsql来源: 在 plsql 中将 blob 图像转换为 PUBLIC.ORDIMAGE

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM