Resize images from table

Hello!
I had following problem.
There is a code, which receives images from one table in RDBMS (images are stored in LONG RAW fields),
reduces them and writes in other table. Here the code:
OracleStatement stmt = (OracleStatement)con.createStatement();
OracleResultSet rs = (OracleResultSet)stmt.executeQuery("SELECT image FROM bigimages WHERE IMGID=1");
if (rs.next()) {
InputStream in=rs.getBinaryStream(1);
OutputStream out = new FileOutputStream("C:\\TMP.JPG");
JPEGImageDecoder decoder=JPEGCodec.createJPEGDecoder(in);
JPEGImageEncoder encoder=JPEGCodec.createJPEGEncoder(out);
BufferedImage sourceImg=decoder.decodeAsBufferedImage();
BufferedImage img=scaleToSize(nWidth, nHeight, sourceImg);
encoder.encode(img);
InputStream fStream = new FileInputStream("C:\\TMP.JPG");
try {
OraclePreparedStatement pstmt = (OraclePreparedStatement)con.prepareStatement("INSERT INTO smallimages VALUES (?,1)");
pstmt.setBinaryStream(1,fStream,fStream.available());
boolean result = pstmt.execute();
pstmt.close();
} catch (SQLException ex) {}
in.close();
out.close();
backimageresize = true;
rs.close();
stmt.close();
But for some reasons it is necessary to do without the temporary file.
How it to make?

You mean you want to do that without using a temporary file? If so, then use these two modified lines of code instead:
OutputStream out = new ByteArrayOutputStream();
InputStream fStream = new ByteArrayInputStream(out.toByteArray());

Similar Messages

  • Pages 5.0 removing images from tables.

    After upgrading to Pages 5.0 I now receive a message when opening any file with a table that has images in the cells.  Basically Pages is removing all images from table cells.  Anyone having this problem and is there an easy fix?

    DrBrian, this is what I did to resolve this issue.  I found out that we may still have Pages 09 installed on our systems! Go into Finder - Applications.  If you have a folder titled iWork 09 click it and you may find Pages 09 there.  Double click to open Pages version 09 where you will be able to open all of your files just as they should be. 
    I will not be using the new Pages upgrade.  I have too much time invested in creating documents and templates for my business and I am not willing to re-learn a new package which has much less functionality.  Hope this helps you.

  • Display image from table!

    Hi,
    I have in my aplication a table user, where we can save is image:
    t_user{id_user, name , adress..., foto(blob),foto_size(number),foto_name,foto_mime_type};
    An user can upload his imageand save it in his table!
    I wanted to display his image, but i onle found infomation how to show images saved in htmldb_application_files:
    how to display image from tables?
    Thank's in advance

    Look at the sample application. It shows you how to do this

  • Problem trying to batch resize images from bridge.

    I am trying to batch resize images from bridge. I am on windows 7 desktop and using CC, I select the images in bridge, tool bar>tools>photoshop>image processor. After doing this, photoshop CC opens but no images open.

    open photoshop, open actions pallette, click new action (windows > actions (or Alt+f9)), click record, open your image, resize it, click stop action.
    then use file> automate > batch
    the action you just recorded will be ready to use, select the folder with all your photos (wise to work on a duplicated folder incase you mess up)
    run the action.  wait while photoshop opens and resizes the images one by one.
    check in folder if the images resized how you expected.

  • Fetching  an image from table to be displayed in HTML

    I'm making something similar to the [online store Packaged Applications from Oracle.|http://www.oracle.com/technology/products/database/application_express/packaged_apps/packaged_apps.html]
    I have small problem.
    <td rowspan="5" valign="top"><img src="f?p=&APP_ID.:30:0:#IMG#" width="50" height="50"></td>
    This is how the image is fetch from table EBA_OLS_IMAGES in the online store app. The parameter #IMG# is the id of the image, not the blob file.
    So can some one explain to me how this link works.. What the .:30:0: means.

    hi,
    So can some one explain to me how this link works.. What the .:30:0: means.please read the following link to understand deeply syntax of URL in oracle apex
    http://download.oracle.com/docs/cd/E14373_01/appdev.32/e11838/concept.htm#BEIFCDGF
    With Regards,
    Sunil Bhatia

  • Resize images from DB

    Hello!
    I had following problem.
    There is a code, which receives images from one table in RDBMS (images are stored in LONG RAW fields),
    reduces them and writes in other table. Here the code:
    OracleStatement stmt = (OracleStatement)con.createStatement();
    OracleResultSet rs = (OracleResultSet)stmt.executeQuery("SELECT image FROM bigimages WHERE IMGID=1");
    if (rs.next()) {
    InputStream in=rs.getBinaryStream(1);
    OutputStream out = new FileOutputStream("C:\\TMP.JPG");
    JPEGImageDecoder decoder=JPEGCodec.createJPEGDecoder(in);
    JPEGImageEncoder encoder=JPEGCodec.createJPEGEncoder(out);
    BufferedImage sourceImg=decoder.decodeAsBufferedImage();
    BufferedImage img=scaleToSize(nWidth, nHeight, sourceImg);
    encoder.encode(img);
    InputStream fStream = new FileInputStream("C:\\TMP.JPG");
    try {
    OraclePreparedStatement pstmt = (OraclePreparedStatement)con.prepareStatement("INSERT INTO smallimages VALUES (?,1)");
    pstmt.setBinaryStream(1,fStream,fStream.available());
    boolean result = pstmt.execute();
    pstmt.close();
    } catch (SQLException ex) {}
    in.close();
    out.close();
    backimageresize = true;
    rs.close();
    stmt.close();
    But for some reasons it is necessary to do without the temporary file.
    How it to make?

    Already answered somewhere else. Please don't waste people's time by cross-posting.

  • Resizing Images from Web

    I just purchased the iwork package (I usually get the Mac Office stuff) and am having trouble with web image files. When I attempt to drag an image from the web to my presentation and resize it it looks very pixelated and fuzzy. What am I doing wrong?

    It sounds like you are dragging a thumbnail from the web and when it is enlarged in keynote it is pixelated. Try to find images with a higher resolution. For my classroom presentation I use a lot of photos that I will use only once, and I usually trash them right away, I use flcker frequently for a source of images and I have had no problems, for clip art I use clipart.com but you must pay a membership fee to download the larger sizes.
    Hope this help
    Mireille

  • Resize image from local drive and upload to server

    Hi there
    I want to allow the user to chose an image from his local
    hard drive.
    The image should then be loaded into the Flex 2 application.
    There I wanna show him infos about the image e.g. height and
    width.
    He should then be able to scale/resize the image and upload
    it to the server.
    I have no idea how to do that :-)
    Any thoughts on that?
    Thanks in advance
    Bernd

    Well in short, you need a second language to support that,
    e.g. PHP/ASP/CF.
    First you'll have to build a GUi in which you can upload the
    jpg, putting it to the server using php/asp/cf, then you'll need to
    make a call to that image, (importing it into your flex), then
    you'll have to set the parameters for the resizing, then you'll
    have to call a php/asp/cf script which does te resizing

  • Display resized images in table

    hi, experts,
    I would like to display images on the table view
    in the column properties, I choose the "Image URL"
    !http://img35.imageshack.us/img35/16/17295270.png!
    the images are displayed on the table correctly.
    however, I would like to resize the image (not phyiscally resize the images)
    I choose Custom Text Format and type _@[html]"<img width=""50"" height=""50"" src=""@H"">"_
    !http://img35.imageshack.us/img35/4553/58315768.png!
    but the images cannot be displayed
    !http://img710.imageshack.us/img710/3879/51723842.png!
    thank you very much!

    set your column format to HTML and create a sting like:
    '<img src= "http://www.commentsyard.com/graphics/smile/smile33.jpg" WIDTH=105 HEIGHT=97>'
    Regards John
    http://obiee101.blogspot.com/

  • Displaying BLOB images from table in a report

    I am trying to upload images to a table, display them in a report afterwards. I have succeeded in the first part, but not in the second.<br>
    <br>
    I can display images in a report if they are in located in wwv_flow_file_objects$ where they are automatically put after 'File browse... + Submit'. <br>
    But, if I move (insert into table + delete from ..object$) I cant display it in a report correctly. I saw the HOWTO document (the code was from there), but for some reason, it doesn't work.<br>
    <br>
    What am I doing wrong? How should I correct the column link or the procedure?<br>
    <br>
    REPORT SQL:<br>
    <br>
    id,<br>
    name,<br>
    filename,<br>
    img src="display?p_photo_id=' || nvl(id,0) || '" height="50" width="50"'<br>
    --wwv_flow_file_objects$ display<br>
    --img src="p?n=' || nvl(id,0) || '" height="50" width="50" ' img,<br>
    BLOB_CONTENT,<br>
    MIME_TYPE<br>
    from images;<br>
    PROCEDURE 'display':<br>
    create or replace procedure display (p_photo_id in number)<br>
    as<br>
    l_mime varchar2(255);<br>
    l_length number;<br>
    l_file_name varchar2(2000);<br>
    lob_loc BLOB;<br>
    begin<br>
    select mime_type, blob_content, name, dbms_lob.getlength(blob_content)<br>
    into l_mime, lob_loc, l_file_name, l_length<br>
    from images where id = p_photo_id;<br>
    owa_util.mime_header(nvl(l_mime,'application/octet'), FALSE );<br>
    htp.p('Content-length: ' || l_length);<br>
    htp.p('Content-Disposition: filename="' || l_file_name || '"');<br>
    owa_util.http_header_close;<br>
    wpg_docload.download_file( Lob_loc );<br>
    end;<br>
    <br>
    Many thanks!<br>

    Alayan - If you're using XE, that shoud be the first thing you tell us. There is a separate forum for that product.
    But as long as you're here, a couple points: you reference the "display" procedure in the img tag without qualifying it with an owner. How is the Embeded PL/SQL Gateway supposed to know what "display" is (unless you created a public synonym)? Next, in XE you need to explicitly enable access to procedures that are invoked this way. See the XE forum for discussion about that technique and read the doc here: http://download-uk.oracle.com/docs/cd/B25329_01/doc/appdev.102/b25309/adm_wrkspc.htm#BEJCGJFJ.
    Scott

  • How to resize image from 40k to 200k?

    I am trying to upload images around 40k to a website but it tells me images must not be less than 200k and to upload higher quality images instead.  I have tried everything including save as and save for web, etc., to no avail.
    Your help will be much appreciated. 

    It looks like some of the original images are doing ok in that I am able to adjust their quality by using the Save As slider if the images are big enough to begin with.   However if they are already under 200k, I am out of luck.  These images were sent to me by a friend to upload for her at the Zillow website.  I am afraid she is out of luck as she did not save the originals that were bigger. 
    I just tried the Save for Web feature and much to my surprise I was able to increase the size from 40 to 208 by increasing the width from 500 to 800, contraining the proportions.  It looked too big at that screen, so I thought I lost some of the image.  I went ahead and saved it with a different name.  Then I closed it and reopend it.  Much to my surprise I had not lost any of the picture, and it is at 208k. 

  • Resizing image from 72 dpi from FCP

    When re sizing an image which is 72 DPI in Gimp, exported from FCP,  what dimensions should I enter for size of image when transposing to 300DPI? Images into Gimp from Panasonic GH2 are 4976/2800  pixels.
    Catherine?

    Yes, images coming out of FCP are 72dpi.  I can change the dpi in gimp to the required 300dpi for the printer...the image appears very small in an email...so I beleive I should size my image accordingly when i change the dpi...SO my question is what is a standard image size.  The image will go in a film festival program.  Does one refer to standard photographic inches measurments, like 5 by 7.
    I SORT OF GET IT FROM THIS TUTORIAL BELOW BUT NOT 100%
    To summarize, the "size" of digital photos on a computer can mean one of two things. First is the amount of disk storage needed, and second is the pixel dimensions (width and height). Neither of them use inches, so DPI (dots per inch) can't describe a digital photo's size on a computer. Dots per inch only makes sense when printing, scanning, or other situations that have a physical component. As mentioned above, DPI describes the function of a device, not the size of a digital photo.
    If somebody asks you to email them a 300dpi photo, ask them to show you an inch of email!

  • WD ABAP - Resizing image from ECC Repository

    Hi All,
    Our ABAP guys told us that on WD ABAP isn´t possibile to resize a picture that was taken from the ECC Repository.
    Our situation is the following: We have develop a new WD ABAP application to run on the Employee Self-Service and our problem is that the customer don´t have any default pictures size, I mean, some employees photos has 800x600 and others 50x50 for example. Is there a way to default/resize a photo on the WD ABAP?
    We don´t want to resize all pictures on the original file because we are talking about a lot of photos.
    Thanks!
    Daniel Kiel

    Hi ,
    Yes the same application is working fine if checked directly from ABAP WAS.
    Regards
    Deepak

  • External monitor resizing image from timeline

    Hi Good Folks
    I'm using an 800 x 600 output from FCP and trying to get my VGA external monitor to show me the canvas. I have tried all the permutations of A/V device output - here's what happens: my canvas is playing a clip which is 800 x 466 in origin. I moved to the bottom of the screen as needed and when it is not playing back, the image on my external monitor is correctly seen. When I hit playback, it shrinks vertically about 50% or so... can't figure out why! The external monitor is set to 800 x 600. This worked before with a different version of FCP.
    Any advice appreciated!
    John

    Mr. T-Cat
    Thanks for replying. I understand you read and respond to many many posts... I am doing a video art installation in a large gallery and I "map" my video parts onto walls or areas which need to be tweaked with distort parameters or other modifications while in place. I hook up a video projector via VGA to my laptop and finish the video in the gallery. My video projectors work fine at 800 x 600. For video projection 800 x 600 is a standard video resolution. This is a problem with FCS3 as I have used this technique last year w/ FCP6. Motion 4 outputs the correct image and does QT7 & 10. I must have screwed up my sequence settings somehow? I followed another's advice and made an 800 x 600 ProRes422 seq. setting. When I drag a clip into the timeline a pop up window implies that External Video is not optimized, asks Yes or No - advice was No. FCP still says clip doesn't match my sequence settings and crushes the vertical height when playing back even if I drag a full 800 x 600 ProRes clip into my sequence, or say Yes change the seq settings to match.
    Thanks
    btw, I will the program Isadora outputting 3 video streams (AIC @ 800x600) through a Matrox TH2Go into the three projectors each set at 800x600. The Matrox only does a 2400 x 600 output on my MBP thus the resolution.

  • How to disable resizing images and tables in designMode?

    In own wysiwyg editor this function must be disabled. How make it disabled?

    A good place to ask advice about web development is at the MozillaZine "Web Development/Standards Evangelism" forum.
    *http://forums.mozillazine.org/viewforum.php?f=25
    The helpers at that forum are more knowledgeable about web development issues.<br>
    You need to register at the MozillaZine forum site in order to post at that forum.

Maybe you are looking for

  • Data transfer from application server to sap system in binary mode

    hi friends, can any one help me out in how to read,open the dataset (syntax) while transfering the file from application server in binary mode ? how to move the file to differrent location in the same server? regards, mohan Message was edited by:    

  • Error  in SXMB_MONI for Idoc to File Scenario (missing of field plant

    Hi SapAll. here i have got a tricky situation where in a Idoc(Matmas.Matmas05) to file Interface thorugh XI there is an error message raising in sxmb_moni. to get the conclusion for this error i just copied the message from Sxmb_moni and tried with 

  • How to change highlight color of a focus Button

    When a Button gained focus, there is a dotted line around the button label. I'd like to change the color. Not able to find out how. Is it possible? Please help.

  • Java Event Timing / Scheduling Question

    Hi everyone, Looking for some pointers in the right direction. I'm writing a program that controls a hardware device to operate outputs at specific times in a timeline defined by the user. The delays between events are not regular and may vary from 1

  • Preview lag problem on Premiere Pro CC 2014

    Hi everything! I have a big problem on Premiere, when I work on every type of file the Program monitor lag too much. I can see one frame every few second! But the audio work well... It seems that the computer have not enough power to show the video!