BLOB Images in and out of Oracle

Hi all, I'm using CF8 and storing images in Oracle as BLOB datatypes.  I am not able to use CF to write files to the file server.  I have about 50 large images already stored that need to have thumbnails made of them and stored in another field in each record.  So, I need to do this:
Pull the BLOB out of the database.
Make it a CF image.
Resize the image.
Make the new image a BLOB.
Put the new BLOB in the database.
The issue I'm having is that when an image starts out as a BLOB it doesn't seem to know the file type, so when I try to do step 5, above, I get "Verify your inputs. The source file should contain an extension,so that ColdFusion can determine the image format."  It seems that if I start with an actual file in step 1 it works, but not if it's binary to start.  This is my basic code edited for clarity.
<cfset thisImage = ImageNew(get.file_binary)>
<cfset ImageResize(thisImage, "500", "", "mediumQuality")>
<cfquery name="update" datasource="#dsn#">
        UPDATE images
        SET file_binary_thumbnail = #ImageGetBlob(thisImage)#
        WHERE image_id = #get.image_id#
</cfquery>
Any idea how to get this to work?  Thanks, everyone!

Glowball wrote:
 <cfset thisImage = ImageNew(get.file_binary)>
It could be that imageNew() expects an image as parameter, and not on a binary. What happens when you first convert from binary to image, like this?
<cfset imageAsBase64String   = binaryEncode(get.file_binary, "base64")>
<cfset thisImage                       = imageReadBase64(imageAsBase64String)>
<cfset ImageResize(thisImage, "500", "", "mediumQuality")>
etc.

Similar Messages

  • How to split the blob byte array and insert in oracle

    how to split the blob byte array and insert in oracle
    I am having a string which is of more than lenght 4000 so i am using BLOB datatype as input to get the string.
    need to split the blob in oracle and store in the different column
    The string is of bytearray i need to strore it in each column based on the byte array.

    this will be my input i need to split the above and store it in different columns in a table.
    for spliting say
    Column1 -1 byte
    Column2-3 byte
    Column3-5 byte
    ColumnN-5 byte
    Table will have corresponding data type
    Column1 - number(10,2)
    Column2 - Float
    Column3 - Float
    ColumnN-Float
    here Column2 datatype is float but it will always have 3 byte information.
    where as Column3 datatype is also float but it will always have 5 byte information.
    Say N is Column 120

  • How do you fade images in and out?

    Okay I know you use alpha to fade images in and out,but how?
    I want to fade oneimage in and then fade it out, then fade another
    one in rightafter it. How do I do this?

    hi,
    first frame - alpha 100
    last frame or anyother frame - alpha0
    between those frames, create a motion tween.
    it will fade as the movie plays. you have to implement it
    according to your needs.
    hope it helps,
    gaurav

  • Is there a way to zoom images in and out without changing the frame?

    It is easy to move an image around within a frame without touching the frame, but I have not found a way to zoom in and out without touching the frame. I'm working with a lot of images (Indesign CS6 for PC) and I need to do this a lot. Thanks.

    I don't know what is the correct terminology, but none of those things does what I want.  With the Content Grabber I can move the image and see where it is going and place it where I want it, and the frame does not move and is not changed in any way. I want something that does exactly the same thing with "zooming" in and out on the image.
    Shift-drag on the corners moves the frame.  In the Transform panel, in the lower box, it makes the image AND the frame larger or smaller. Neither of these is what I want.
    If I'm not using the right terminology, let me try to explain.  If I have an image that is larger than the frame, then I can only see a small part of the image inside the frame.  If I could zoom out on the image, I would then see a larger part of the image in the frame, but the frame would be exactly the same size and in exactly the same place (just like it would be when you use the Content Grabber).  If I could zoom in on the image, then I would see less of the image but in more detail.
    If I could move (like the Content Grabber) AND zoom without doing anything with the frame, then I could get the image just the way I want it inside an already-properly-placed frame in the most straightforward and simple manner, and be able to see what I was doing in the process. Dragging on the corners is basically trial and error because you have to go through several steps before you see the final result.

  • In Report 6i, Blob image not showing

    i save blob image file in database using Oracle Form 6i.
    and now i create report to display image.
    Select id, Foto
    from table
    Image field is created, then i changed format type as image.
    Now the error displaying when i execute report is
    rep 1818: Unable to read data in image format
    and rep: -619 you can not run without a layout.
    Please help me.

    rep 1818: Unable to read data in image format
    and rep: -619 you can not run without a layout.
    this is the error

  • Oracle lite application not showing blob images in BI reports

    Hi,
    We have an application running in Oracle lite, we integrated the BI publisher reports (PDF reports are generated Using Data template and RTF file with Java API for BI publisher) with the application. Its been working fine for a long time.
    Now we are showing some images on the pdf report, the images are stored in the Oracle lite database as blobs. My application fails when translating the Data template to xml data. I am not getting any exception other than out of memory error after a while.
    anybody had the same problem? Let me know if you need more information on this problem.
    Any help will be great!!
    Regards,
    Parthiban Kumar
    Edited by: Parthiban Kumar on Nov 12, 2009 10:45 AM

    Hi Carsten
    That was exactly* I was looking for. Maybe I should Google more in German ;-)
    The main problem was that I defined my image outside the first repeating group (that doesn't repeat, it's always just one object) - the first group is followed by 7 more.
    Just like the "Name" (that's positioned outside the group in the document header), I positioned the image above the table representing the group.
    Doing that, the "Name" is filled correctly, the Image only when the Output Format is Excel or HTML - not Word or PDF ... makes no sense but that's tje way it is.
    After moving the image inside the group....it works great!
    (One more thing...the image size is fixed to the image you use as "dummy". Is there any way to make that more flexible, because now some scaling happens...)???
    @Trent: That was the way we initially did it, but when the size of the row exceeds 32K...you know what happens.. And even with a small image the 32K limit is hit easily
    The way I use it now (very similar to Carsten's description) there is no limit....
    Thank you all!
    Roel

  • Managing blob images using ADF and JSF or struts

    Hello everyone. I am an ADF newbe and I am developing a web app. that has to manage (display, insert,update and delete) blob images from/to an oracle DB. I've seen the "howto" on image managing using intermedia and struts, but, for this new app I wanted to use JSF (something that is not mandatory) and, what is important is that the DB has already stored the images in blob format.
    Can anybody point me in the right direction please??? Is there any howtos on this subject???
    Thanks in advance.

    jfin wrote:
    but so far I have to say that I like the fact that I'll have to do very little
    System.out.println(<..../>....<>....</>).Assuming that you rather mean out.println() where out is the ServletOutputStream reference returned by HttpServletResponse#getOutputStream(), I can only agree with you. That's certainly not the way how JSP/Servlet code is to be written. The maintainability, extendability, reusability and testability would be far below the freezing point then. You need to write presentation logic in JSP files, not in Servlets and absolutely not in scriptlets inside a JSP.
    When you need to write presentation logic which may change per request, use JSTL and EL for that. Again, not scriptlets. For business and controlling logic, use Servlets. For transfer of data, use javabeans (DTO's, VO's). For data access logic, use DAO classes which are to be interacted by servlets.
    JSF removes the need for creating Servlets and using JSTL/EL in JSP files. You just have JSP pages with JSF tags for presentation and javabeans for the request values and backing beans for business logic.
    When would one use JSF over the other two? When Struts2? When Shale?And you ask that in a JSF forum? At least my opinion is predictable :)

  • I need to display my Blob image in my report (and also on form page)

    Scott,
    I followed the APEX advanced tutorial for uploading and downloading files. I have created a form on a table and that table contains a column of datatype BLOB. Now I want to be able to display the (Blob) images that I have uploaded.
    As I research the topic, I get the feeling that displaying the BLOB image can only be done in APEX 3.1 and up. Is this true? I have that version of APEX installed on my laptop and have successfully completed the "Defining and Viewing BLOB Data in Oracle Application Express 3.1" tutorial found here: http://www.oracle.com/technology/obe/apex/apex31nf/apex31blob.htm
    But I could not do it on the company server that runs APEX 3.0
    Even if I did get the approval to have the company APEX application upgraded to 3.1, there still is the issue of scaling the images so that they are not so large. I understand that there is a UTIL.APEX function "GET_BLOB_FILE_SRC" that would do this for me. I read the documentation at:
    http://download.oracle.com/docs/cd/E10513_01/doc/appdev.310/e10499/api.htm#CHDICGDA
    After reading it, I was still not clear as to how to use it correctly. Is there any documentation on how to implement this function in APEX?
    I did find something that I was hoping would help me. The article is entitled "Show Blob of other table in APEX Form" by Dimitri Gielis can be found here: http://dgielis.blogspot.com/2008/07/show-blob-of-other-table-in-apex-form.html
    I tried to import the file "blob_support.sql" application (on both APEX 3.0 and APEX 3.1 systems) but got errors. I'm not having very much luck here and would appreciate the help in pointing me in the correct direction.
    Help!!
    Thanks
    LEH

    Hello John,
    Your information was helpful. I can now see my images in my form.
    OK, now I would like to be able to call the image using a Region Source of type SQL instead of the HTML Expression. The reason for this is because I need to use logic to determine if the file is an image or not and to determine wether to show a thumbnail or just a link. I did find a "GET_BLOB_FILE_SRC" Function on the internet that suggests that I could do this but I need some help in making it work in my application.
    Here it is as a Region Source of type SQL:
    SELECT ID,
    NAME,
    CASE WHEN NVL(dbms_lob.getlength(document),0) = 0
    THEN NULL
    ELSE CASE WHEN attach_mimetype like 'image%'
    THEN '<img
    src="'||apex_util.get_blob_file_src('P4_DOCUMENT',id)||'" />'
    ELSE '<a
    href="'||apex_util.get_blob_file_src('P4_DOCUMENT',id)||'">Download</a>'
    end
    END new_img
    FROM TEST_WITH_BLOB
    If anyone can help me with this that would be appreciated.
    Thanks
    LEH

  • Get canvas.toDataURL('image/jpeg') and convert base64 encoding to java.sql.Blob

    Convert canvas.toDataURL('image/jpeg') to java.sql.Blob.
    I am using oracle adf so I am able to action a backing bean from javascript and pass in parameters as a map. I pass in the canvas.toDataURL('image/jpeg') which I then try to decode in my bean. Using BASE64Decoder and the converting the bytearray to a file I can see the image is corrupted as I can't open the file thus converting the bytearray to blob is also a waste.
    Has anyone any ideas on base64 encoding from canvas.toDataURL to file or Blob?

    Use Case:
    A jsf page that enables a user to take photos using the HTML5 canvas feature - interact with webcam -, take photos and upload to profile
    1. I have created the jsf page with the javascript below; this pops up as a dialog and works okay and onclick an upload image, triggers the snapImage javascript function below and sends the imgURL parameter to the serverside managedbean
    <!-- java script-->
    function snapImage(event){
                    var canvas = AdfPage.PAGE.findComponent('canvas');
                    AdfCustomEvent.queue(event.getSource(),"getCamImage",{imgURL:canvas.toDataURL('image/jpeg'),true);
                    event.cancel();
    <!-- bean -->
    public void getCamImage(ClientEvent ce){
    String url=(String)ce.getAttributes().get("imgURL");
    decodeBase64URLToBlob(url);
    private BlobDomain decodeBaseB4URLToBlob(String url64){
                    BASE64Decoder de=new BASE64Decoder();
                    byte[] bytes=de.decode(url64);
                    File file=new File("abc.jpg");
                    InputStream in = new ByteArrayInputStream(bytes);
                    BufferedImage bImageFromConvert = ImageIO.read(in);
                    in.close();
                    ImageIO.write(bImageFromConvert, "jpg", file);
                    return createBlobDomainFromFile(file);
    ----problem---
    Accessing the generated jpeg file shows the image is corrupted, probably missing bytes or encode/decoder issues.and the blob image after uploading to database is saved as a binary stream which ondownload doesnt render as an image or anything i know of.
    Is there anyways of achieving the conversion without errors?

  • Retrieve Image from SQL Server and Store in Oracle

    Hi All
    I want to retrieve the image stored in sql server as a image type and store that image to oracle as a BLOB type.
    I tried to retrive the image from sqlserver using getBytes and when storing to Oracle i have to type cast the byte array to BLOB then only it will be inserted please tell how to typecast byte array to BLOB.
    Or is there alternative way how to retrieve the image stored in sql server as a image type and store that image to oracle as a BLOB type.
    Regards
    Majid

    Hi Rajaram
    Thanks for UR Reply
    I tried what you have suggested but i am getting following exception
    java.lang.NullPointerException
    CDVLogger--getInstance--entered in ----getInstance----- null
    CDVLogger--getInstance--entered in ----logPrinter----- null
    CDVLogger--getInstance--entered in ----logger----- com.uttra.cdv.base.util.CDVLogger@b0ce8f
    at javax.sql.rowset.serial.SerialBlob.<init>(SerialBlob.java:82)
    at com.uttra.cdv.bulkimport.oracletca.image.FamilyMemberPhoto.createFamilyMemberPhotoRec(FamilyMemberPhoto.java:95)
    at com.uttra.cdv.bulkimport.oracletca.image.FamilyMemberPhoto.LoadFamilyMemberPhoto(FamilyMemberPhoto.java:55)
    at com.uttra.cdv.bulkimport.oracletca.image.FamilyMemberPhoto.main(FamilyMemberPhoto.java:136)
    Please Suggest

  • The photos in my IPhoto have all become mini-thumbnails and I can't open or edit them. When I print the image it comes out normal size.  How do I get the thumbnails back to the standard size and be able to work with them?

    The photos in my IPhoto have all become mini-thumbnails and I can't open or edit them. When I print the image it comes out normal size.  How do I get the thumbnails back to the standard size and be able to work with the photo files?

    What version of iPhoto and system are you running?  On the guess that you're running the latest iPhoto, 9.4.2, Try the following:
    1 - launch iPhoto with the Command+Option keys held down and rebuild the thumnails, Option #2.
    2 - It may take 2-3 attempts so don't give up after only one attempt.
    OT

  • Reduce image size and print it out?

    I scanned an image (coloring on a postcard). This size is too big to fit into a 'album' picture in MS Picture It! All I want to do is REDUCE the image and save it so that it will fit into the computer photo album I'm creating.
    I've tried Image/Resize/Image Size and changed the sizing, but it still comes out the exact same size as the original. What am I doing wrong?

    > I want to REDUCE the image, not enlarge it.
    I understood that - what makes you think I didn't?
    > It's 948x645 pixels. I just want the image about an inch (respectively) smaller
    You can't think in terms of inches for screen images. You have to work in pixels and the actual size will depend upon the screen resolution on the machine being used to view the image.
    I'd reduce the pixel size by about 80 to get the effect that you want. Use Image/Resize/Image Size and make sure that you have "Resample" checked.

  • How to store photo images and thumbimpressions in oracle 10g database

    Hi all
    I have an web application running in Oracle 10g rel 1 database server in RHEL3. It has application server with forms and j2ee component as middle tier. I need to store centrally photo images and thumb impressions and use it in our application without any overhead on retrieval and performance of web application. what will be optimized method of storage of photo and thumb impressions. Awaiting your valuable suggestions.
    Regards
    Vijay Kumar

    Hi Vijay,
    How to store photo images and thumbimpressions in oracle 10g database I have working code here for storing photos in Oracle tables that you may find useful:
    http://www.dba-oracle.com/t_storing_insert_photo_pictures_tables.htm
    Hope this helps . . .
    Donald K. Burleson
    Oracle Press author
    Author of "Oracle Tuning: The Definitive Reference"
    http://www.rampant-books.com/book_2005_1_awr_proactive_tuning.htm

  • How to check ,how many  users are logged in and logged out in oracle ebs 11i/R12.

    Hi Experts,
    Kindly let me know
    how to check ,how many  users are logged in and logged out in oracle ebs 11i/R12.
    Also, in the database level too ,Do we need to write any trigger for this?
    Thanks in advance.

    Hi,
    How to check ,how many  users are logged in and logged out in oracle ebs 11i/R12.
    Please check the following links:
    Oracle EBS - Number of Users logged into EBS / Oracle Applications currently
    List all users currently logged in on Oracle EBS
    Also see forum Search:
    Forum Search: Logged In EBS User
    Also, in the database level too
    Please see:
    https://forums.oracle.com/message/9225094#9225094
    Do we need to write any trigger for this?
    Yes you may, But I personally suggest you not to do so as it may affect performance.
    Thanks &
    Best Regards,

  • Hi, I have a Catalyst 6500 with X6K-SUP2-2ge, the IOS and bootlader image been wiped out, it starts in ROMmon SP mod end can't switch to RP to start download the IOS using Xmodem, though it shouldn't work in ROMmon SP omde but the xmodem is not gving the

    Hi, I have a Catalyst 6500 with X6K-SUP2-2ge, the IOS and bootlader image been wiped out, it starts in ROMmon SP modw and I can't switch to RP to start download the IOS using Xmodem, though Xmodem shouldn't work in ROMmon SP mode but the it's not gving the
    not executable message, the slot0: and disk0: are not accessable can't see the files inside, when I try the dir slot0: or dir disk0: it says it can't be opened and when I try to boot from them there's noting as well, what can I do to load an IOS image to the booflash: or slot0: ,each time I load the image using Xmodem at the end it gives me *** System received a Software forced crash ***
    signal=0x17, code=0x5, context=0x0
    When I run the command:
    rommom1> boot bootflash:
    boot: cannot determine first file name on deice "bootflash:"
    rommon2> boot slot0:
    boot: cannot open "slot0:"
    boot: cannot dtermine first file name on device "slot0:"
    BTW  System Bootstrap, version 7.1
    I''m looking to format the PCMCIA using a PC and format it to FAT16 and copy the boot image into it and then try to load from the PCMCIA afterward if it works I'll format it using the Supervisor engine 2.
    Any one have another new idea I can use, thanks in advance

    This is a potentially complex issue.
    Is this SUP configured to run as IOS native or CatOS Hybrid?
    While in ROMMON can you do the 'dev' command and see whad drives are recognized. Then 'dir' the drives that the SUP recognizes.
    Can you provide the screen captures as it boots?
    You would be bette served by hacing a TAC case.

Maybe you are looking for