This discussion is archived
3 Replies Latest reply: Jun 18, 2009 11:31 AM by 251301 Branched to a new discussion. RSS

ORA-29400 when converting image to thumbnail

675131 Newbie
Currently Being Moderated
I am receiving the following error stack when trying to convert a full image stored in a blob column (image is 2.2 MB) into a thumbnail column on the same table:

ORA-29400: data cartridge error
IMG-00002: unrecoverable error
ORA-06512: at "ORDSYS.ORDIMERRORCODES", line 75
ORA-06512: at "ORDSYS.ORDIMERRORCODES", line 65
ORA-06512: at "ORDSYS.ORDIMG_PKG", line 115
ORA-06512: at "ORDSYS.ORDIMAGE", line 648
ORA-06512: at "SVDBS.PHOTO", line 41
ORA-06512: at line 1

The procedure I'm running is below, and the error seems to be associated with the scaling of the image (ordimage.process(l_thumbnail, 'fixedScale=50 50');).

PROCEDURE create_thumb
(p_sample_content_photo_id IN NUMBER)
is
l_photograph sample_content_photos.photograph%TYPE;
l_modified_photo sample_content_photos.modified_photo%TYPE;
l_p_size NUMBER;
l_t_size NUMBER;
l_mp_size NUMBER;
l_thumbnail BLOB;
BEGIN

-- Fetch the photo and modified photo as well as their sizes
SELECT
photograph,
modified_photo,
dbms_lob.getlength(photograph) p_size,
dbms_lob.getlength(modified_photo) mp_size
INTO
l_photograph,
l_modified_photo,
l_p_size,
l_mp_size
FROM
sample_content_photos
WHERE
sample_content_photo_id = p_sample_content_photo_id
FOR UPDATE;

-- If the size of the modified photo is > 0, then use it; otherwise, use the original photo
IF l_mp_size > 0 THEN
l_thumbnail := l_modified_photo;
ELSE
l_thumbnail := l_photograph;
END IF;

-- Scale the image down to 50x50
ordimage.process(l_thumbnail, 'fixedScale=50 50');

-- Update the source table with the newly scaled thumbnail image
UPDATE
sample_content_photos
SET
thumbnail = l_thumbnail
WHERE
sample_content_photo_id = p_sample_content_photo_id;

END create_thumb;

Thanks for any ideas

PK
  • 1. Re: ORA-29400 when converting image to thumbnail
    251301 Explorer
    Currently Being Moderated
    Version and platform please?

    Does this problem happen with every image or just some image? What is the size (width, height) of the problem images? Do you get a trace file?

    Are you aware that you are modifying the original image? You perform a process on either the photograph or modified_photo blob. The process meothd is an in place operator. The processCopy method will read from a source image and write to a separate destination. The original source image is not modified. It does not seem that you want this behavior.

    To use processCopy, you would select the thumbnail blob as well and use ordimage.processCopy(). If you are using just blobs, and not ordimage objects, then there is no need for the final update statement.


    rob
  • 2. Re: ORA-29400 when converting image to thumbnail
    217816 Newbie
    Currently Being Moderated
    Having the same / similar problem as stated above. It only started recently, perhaps due to some newer format or perhaps the default size of the image when it it downloaded from the camera or phone to the PC (before it is uploaded to the database).

    We're storing content inside the 11g database on Solaris using Intermedia objects (ORDSYS.ORDImage for all photos) and processing each photo using processCopy method to make thumbnails.

    The error message is this:

    Oracle.DataAccess.Client.OracleException ORA-29400: data cartridge error
    IMG-00002: unrecoverable error
    ORA-06512: at "ORDSYS.ORDIMERRORCODES", line 75
    ORA-06512: at "ORDSYS.ORDIMERRORCODES", line 65
    ORA-06512: at "ORDSYS.ORDIMG_PKG", line 155
    ORA-06512: at "ORDSYS.ORDIMG_PKG", line 765
    ORA-06512: at "ORDSYS.ORDIMAGE", line 63

    The error is only happening with some images.

    Size of problem images is: 275 x 81
    Format: JPG
    Size: 6.99KB

    I then took the image and resized it to 494 x 259 (same format), and it continued to fail to upload with the same error message.

    However, I took another photo with the same dimensions and format which was also failing to upload, and resized it to 529 x 280 and it uploaded just fine.

    I then went to the first image that was failing, opened it in Paint and then saved it as a GIF instead of a JPG. It uploaded fine after that.

    Not sure if the dimensions of the original file are causing the error during the processCopy stage, or if it is the Format of the image that is causing the problem. Or both ...

    Any insight or suggestions are much appreciated.

    LJ
  • 3. Re: ORA-29400 when converting image to thumbnail
    251301 Explorer
    Currently Being Moderated
    Can you make a sample problem image (original size and format) available?

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points