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.

Similar Messages

  • 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.

  • 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

  • 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());

  • 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 do I resize image?

    How do I resize image from 720 to 1080 in after effects?

    Have you tried using the Scale property? Click the arrow to the left of a layer's name to expand its properties. Alternatively you can click on the layer in the timeline and press the "s" key to expand the Scale property for that layer. By default, scaling retains the original proportions; if you wish to disable this and scale something out or proportion then uncheck the little "constrain proportions" icon in the Scale property.
    An even easier way is to simply click on a layer in the composition view and drag the small boxes at the edges of the layer.

  • Video image from webcam resizes

    I am trying to develop a online presentation application which has the webcam feature. I am using JMF for this purpose. I am creating this as an applet. The first time when the page loads and the user clicks the start button to start the video, the webcam starts and the video is displayed in a small area of the applet.
    The left side of the applet displays the images. When the user clicks the next button, the next image from the vector is displayed and the image label displays the image number as 2.
    The problem is that, if the user clicks next button , the video image from the webcam gets resized. It scales itself in the horizontal direction. I have no clue as to why is this happeneing. Is this something due to the layout problem or JMF ?
    Any help in this matter will be highly appreciated.
    Regards,
    Sharad

    I guess its because you are having a BorderLayout. If with a borderlayout, components added will strech both ways (horizontally and vertically) but you seem to say that the video image strechs only horizontally, maybe components added to NORTH or SOUTH of a borderlayout would do that.
    Anyhow, try to set the layout to FlowLayout

  • How does one set the DPI when resizing images in Bridge?

    I am sure I am missing something here (so excuse me if its a simple answer) but I am used to using Photo Mechanic and there you are able to set lots of variables while resizing.  I don't understand this Bridge resizing window when using Batch Processing thru Photoshop. 
    -There are two boxes for sizing.  If you put the same dimension in both does it just set the longest dimension to that size?
    -What if I want say a 10x10 inch image at 72 DPI for web use as opposed to a 10 x10 inch image at 300 DPI for printing purposes, where does one enter that info?
    Thanks,
    Joshua

    You don't "resize" anything in Bridge, nor does it set PPI, pixels per inch—and most certainly NOT "DPI" (Dots [of ink] Per Inch) which is exclusively a feature of the printer.
    Bridge is just a File Browser.  It used to be called simply the Photoshop File Browser".  It doesn't open, edit, manipulate resize or even save anything.
    It merely hands the file(s) over to the appropriate application, whether that be Photoshop, adobe Camera Raw, Illustrator, InDesign or even MS Word.
    You wrote:
    -What if I want say a 10x10 inch image at 72 DPI for web use as opposed to a 10 x10 inch image at 300 DPI for printing purposes, where does one enter that info?
    Again, you mean PPI in both instances there.
    You enter that in whatever application you're sending the image from Bridge.
    For instance in Photoshop:

  • Need help on quality of resized image!!

    I am required to resize images to max 1240pixel (longest dimension) as a submission of work, though when work is viewed it will be at 30"x40".  Can not figure out a way to do this where images don't become quite pixelated when viewed at larger size.   Appreciate any suggestions. 

    Is there some software to verify if my graphics card is shotty?
    Techtool Pro has some testing, the AHT tests VRAM, but game benchmarks and stressing will tell you the most.
    Is re-seating the graphics card or memory worth trying?
    Absolutely. Just don't reinstall the graphics card until you clean it thoroughly.
    Cleaning the dust out of my machine?
    YES. A dust filled graphics card heatsink will cause the GPU to cook, and cause problems thet you describe.
    If I need a new graphics card, what are my options? Do I have to purchase it via Apple store? I would like to stick with an Nvidia card so am I stuck buying the same card I currently have or can I upgrade?
    You don't have to buy from Apple, but using with OS X limits your choices to Mac compatible or flashable PC versions.
    There is an awful lot of user input into this topic here:
    http://blog.macsales.com/602-testing-those-new-graphics-cards
    Card reviews can also help:
    http://www.anandtech.com/video/showdoc.aspx?i=3140&p=9
    http://www.tomshardware.com/reviews/radeon-hd-4870,1964.html

  • Disk Utility: Create Image from Volume Without Unused Space

    I'm trying to create a disk image from a mounted volume (flash memory in a video camera) but I don't want to write to it later, it's just for archiving. The problem is that the size of the original volume is 16 GB, so every image I create is huge, even if there is less than a 1 GB used.
    For example, I only have two short clips on there, about 1.1 GB used. When I create a new .dmg from the volume, the file is 5.28 GB and when I mount it it tells me the size of the volume is 15.3 GB. Clearly I understand why this is happening, it's creating a bit for bit copy of the original volume, but I don't need all that space since I'm never going to write to it.
    In disk utility it won't let me resize the image (it's grayed out). What do I do?

    I actually don't understand why this is happening (when I do this the created disk image only uses the space it needs) but you can get around it as follows. First create a blank read/write disk image to the size you want and then restore the memory card to that image.

  • How do I keep my images from moving when extending or contracting in browser?

    Can anyone tell me if there is a solution to keeping multiple images from moving as the size of the browser is made larger or smaller.  I am in the jewelry business and when I have multiple images, and a customer makes the browser window larger or smaller, it of course moves the images out of position and mixes everything up on different lines.  As opposed to a site like Bluenile.com which images stay stationary as the browser window moves.  I did try to make all my images on "one image" in Photoshop and that does seem to do what I want as far as the images go, but then I cant add links to individual pictures within that page.  Please help !
    One of my pages is http://www.milesgoldberg.com/Gentsbandsspecific.html
    This is one when I extend or contract the window, the content gets all mixed up.
    Now look at http://http://www.bluenile.com/wedding-rings/mens-wedding-rings
    If you extend or contract the window, the content stays in place.

    You're using a liquid layout based on percentages that resizes with browser viewport.  As Ned said, a fixed width Table would be one approach.  Another would be to use a Fixed Width CSS grid like this one (view page source to see the code)
    http://alt-web.com/TEMPLATES/2-col-fixed-layout.shtml
    HTH,
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics |  Print | Media Specialists
    www.alt-web.com/
    www.twitter.com/altweb

Maybe you are looking for

  • How can i use the same cursor in a loop fro multipletimes.

    I am using two cursors.One to fetch sites and the other to fetch participants under each site.I am performing some job with that participants data.Now the problem is i am using the 2nd cursor in a loop.So it fetches the data of participants falling u

  • How do you make the most of your Laptop resources?

    Hello, I was wondering what tricks do experienced Arch users apply to get the best performance (including the HDD settings and power saving techniques)? Please share your experience.... I have a Samsung Laptop,  with broken BIOS for ACPI support. I h

  • Windows 8 look and feel

    HI, is there a way to have the modern look of windows 8 (the content before chrome approach) using jdeveloper to develop a new application? thanks, M

  • ORDERS01 IDoc goes in status 51

    Hello experts, We have a scenario where an inquiry (IN) needs to be created by ORDERS01 IDoc issued from the SAP PI system. PI translation happens fine and IDocs are being created in the R/3 system but they all go in status 51(BD87) with the error ED

  • Re: Accessing PID

    In addition to what Katie Carty wrote, you can also get it through EConsole: 1) Go to the View->Node Outline (does anyone EVER use the NODE TOPOLOGY?!) 2) Expand your node agent. 3) Expand the "Forte_Executor_NodeName" ad-hoc partition agent. 4) Doub