2 Replies Latest reply: Nov 9, 2010 11:12 AM by Mannamal-Oracle RSS

    ORA-29400: data cartridge error/IMG-00703: unable to read image data error

    fac586
      Oracle Database 10g Enterprise Edition Release 10.2.0.2.0

      ORA-29400: data cartridge error
      IMG-00703: unable to read image data
      ORA-06512: at "ORDSYS.ORDIMERRORCODES", line 75
      ORA-06512: at "ORDSYS.ORDIMERRORCODES", line 65
      ORA-06512: at "ORDSYS.ORDIMG_PKG", line 37
      ORA-06512: at "ORDSYS.ORDIMAGE", line 927

      is raised when the following trigger is processing certain JPGs (example). Other JPGs are handled as expected:
      create or replace trigger photo_size_trg
      before insert or update on photos
      for each row
      declare

        photo_width integer;
       
      begin

        ------------------------------------------------------------------------------
        -- Check to see if the new photograph is different from the old one...      --
        ------------------------------------------------------------------------------
       
        if dbms_lob.compare(:old.photo, :new.photo) != 0
        then
          ----------------------------------------------------------------------------
          -- ...if so, check to see if it's wider than the desired 250 pixel        --
          -- maximum...                                                             --
          ----------------------------------------------------------------------------

          photo_width := to_number(ordImage.getMetadata(:new.photo)(1).extract('/ordImageAttributes/width/text()').getStringVal());

          if photo_width > 250
          then
            --------------------------------------------------------------------------
            -- ...and if so, apply an image transform that will resize to the photo --
            -- to a maximum of 250 pixels wide, keeping the original aspect ratio.  --
            -- There doesn't seem to be an elegant way of specifying a constraint   --
            -- in one dimension like this, so the height is specifed as a large     --
            -- enough value to cover all practical contingencies.                   --
            --------------------------------------------------------------------------
           
            ordImage.process(:new.photo, 'maxScale=250 10000');

          end if;
         
        end if;

      end;
      Any thoughts/suggestions?