0 Replies Latest reply on Feb 8, 2010 4:59 PM by mcardia

    ORDImage.process too slow

    mcardia
      Hi, this is my function:

      -- the table banco_image, column bim_src holds the original image (blob type)
      -- the table tmpblob, column tblob holds the thumbnail (blob type)

      function  thumbnail(wbim_id in number) return number
      is
      wblob blob;
      wimg  ordsys.ordimage;
      wtid  tmpblob.tid%type;
      begin
      select nvl(max(nvl(tid,0)),0)1 into wtid from tmpblob;+
      insert into tmpblob (select wtid, bim_src, null from banco_imagem where bim_id = wbim_id);
      select ordsys.ordimage(ordsys.ordsource(tblob, null, null, null, sysdate, 1),null, null, null, null, null, null, null)
      into wimg
      from tmpblob
      where tid = wtid
      for update;
      wimg.setProperties();
      if (wimg.width > 200) or (wimg.height > 200) then
      wimg.process('maxScale=200 200');
      end if;
      update tmpblob set tblob = wimg.getContent() where tid = wtid;
      return(wtid);
      end;

      This function is in a package, so I can use it anywhere.

      It´s working, but too slow.

      If I execute from sqlplus, first execution is slow (10 seconds), next is fast, even with a diferent image.
      But executing in forms takes 10 seconds per image every time.

      Does anyone have an idea?

      Tks.