Thumbnail not rendered in browser

I lifted code posted in this forum for creating a jpg thumbnail courtesy of
--Dmitri Don
http://forum.java.sun.com/thread.jspa?threadID=223186
and it works fine to make a nice sharp image.
I am having a problem with certain thumbnails not showing in the browser. I suspect the size is the culprit but I AM NOT AN IMAGE EXPERT--and have little experience with these APIs. I would deeply appreciate someone's help on this. The thumbnail is being produced, I jsut cannot get the browser to show it for certain files.
An example for a non working versus working is as follows:
-working-:
-original -96KB JPEG
thumb-I can see size=4014bytes, dimension=100X75 px, type=JPEG and created/modified dates in BROWSER properties(right click)
-non working-:
original -670KB JPEG
thumb-size=Not Available, dimension=20X30(!??) px, type=Not Available and created/modified dates=Not Available in BROWSER properties(right click)
When I open the 'non-working' thumbnail in an image editor it has normal properties: size=22500bytes, dimension=100X75 px, type=True Color 24 bit(in MS photo editor)
the code I am using to generate the thumbs:
try {
File originalFile = new File(pathToOriginal);
ImageIcon ii = new ImageIcon(originalFile.getCanonicalPath());
Image i = ii.getImage();
Image resizedImage = null;
int maxSize = 100;
int iWidth = i.getWidth(null);
int iHeight = i.getHeight(null);
if (iWidth > iHeight) {
resizedImage = i.getScaledInstance(maxSize, (maxSize * iHeight)
/ iWidth, Image.SCALE_SMOOTH);
} else {
resizedImage = i.getScaledInstance(
(maxSize * iWidth) / iHeight, maxSize,
Image.SCALE_SMOOTH);
// This code ensures that all the
// pixels in the image are loaded.
Image temp = new ImageIcon(resizedImage).getImage();
// Create the buffered image.
BufferedImage bufferedImage = new BufferedImage(
temp.getWidth(null), temp.getHeight(null),
BufferedImage.TYPE_INT_RGB);
// Copy image to buffered image.
Graphics g = bufferedImage.createGraphics();
// Clear background and paint the image.
g.setColor(Color.white);
g.fillRect(0, 0, temp.getWidth(null), temp.getHeight(null));
g.drawImage(temp, 0, 0, null);
g.dispose();
// sharpen
float[] sharpenArray = { 0, -1, 0, -1, 5, -1, 0, -1, 0 };
Kernel kernel = new Kernel(3, 3, sharpenArray);
ConvolveOp cOp = new ConvolveOp(kernel, ConvolveOp.EDGE_NO_OP, null);
bufferedImage = cOp.filter(bufferedImage, null);
/* write the jpeg to a file */
File file = new File(pathToWrite);
FileOutputStream out = new FileOutputStream(file);
/* encodes image as a JPEG data stream */
JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(out);
com.sun.image.codec.jpeg.JPEGEncodeParam param = encoder
.getDefaultJPEGEncodeParam(bufferedImage);
param.setQuality(0.7f, true);
encoder.setJPEGEncodeParam(param);
encoder.encode(bufferedImage);
catch exception...
thanks
sgv

I realized the problem is nothing to do with the code...thanks anyway...

Similar Messages

  • LIbrary thumbnails not rendering

    I have dozens and dozens of thumbnails in library grid that do not render.  The boxes show up as empty grey squares with keyword icons among others.  There does not seem to be any pattern or reason that some photos render fine and others do not.  If a photo is taken to develop mode then the thumbnail renders as the photo loads in the main window, otherwise the same photos that are all grey in library view are grey in develop view until the individual photo is loaded.  Closing LR and reopening it seems to cause any photo which was originally not rendered but then forced to render in develop to go back to the unrendered state.
    This is driving me crazy as I cannot count on LR to display the images I have in the catalog.  Syncing a folder which has many of these unrendered previews does not indicate any missing files.
    Help.
    Lightroom 3.2 64 bit
    Windows 7
    Catalog w/ about 18000 images upgraded from LR 2.7

    Check other threads in this forum.  I recall this is usually caused by a bad display colour profile. This is apparently more common with some Windows systems.

  • Thumbnails Not Showing in Browser

    I have a portion of my library archived to DVD - masters are offline. I cannot view the associated thumbnail previews in the browser. They are grayed out but can be brought up in the viewer, and show the low resolution version of the image.
    I recall being able to view them at one time, but now the previews are all grayed out. Why and what can I do about it? Thanks.

    I realized the problem is nothing to do with the code...thanks anyway...

  • .svg files not rendering in browser

    I've just uploaded my site (www.elcricdercas.com). None of the .svg files are rendering. This includes an Edge produced file in the front page animation. How come? I've checked the site on Safari and Firefox. The provider is Eclipse.net.uk

    Hi,
    Could you please check this thread, and see if get some hint
    Re: SVG files not rendering in Muse

  • Applet - not rendering n Browser - Mozilla / IE - Help

    Hi,
    I have following code in AnotherHello.html in
    <html>
    <body>
    <applet code="AnotherHello.class" width="300" height="150"></applet>
    </body>
    </html>and the following in AnotherHello.java
    import java.awt.*;
    import java.applet.Applet;
    class  AnotherHello extends Applet
         public void paint(Graphics gr)     
              setBackground(Color.lightGray);
              gr.drawString("Hello", (300/2 - 40/2), (150/2 + 40/2));
    }When I run it using Mozilla or IE it only shows the HTML code in the browser, it does not get me the applet on to the screen. Could somebody help me in figuring out the problem.
    Thanks in advance.

    I have only these two browsers so dont know about
    other browsers.
    No it does not run in applet viewer also.
    I have the class file compiled in the same directory
    as in the java and the html file.
    I am able to see applets from various websites in my
    mozilla browser, which would mean that applet is
    enabled.
    I am not sure what could be the problem.
    Please do let me know.Sounds like it should run then. Maybe it is, but what it's drawing is "invisible" - what about removing that setBackground call, or set it to a different color. If you get a different result, then it is running.

  • Bug: MOV thumbnails not rendering in Bridge

    Bridge CS6 is failing to render the thumbnails of my iPod videos in the Content panel although Bridge CS5 does so handily.
    - Use APD to download images from iPod Touch, 4th gen
    - Bridge opens to new directory
    Generic thumbnails appear is CS6 where a representative image appears in CS5
    I expect Bridge to display a thumbnail of the initial frame of the video instead of a generic icon.
    Mac OS v10.6
    Cheers
    -Saïd

    Hi,
    Can you please try:
    1. Install the latest Bridge build by installing latest Photoshop build
    2. Remove the folder /Users/[username]/Library/Application Support/Adobe/Common/Media Cache
    3. Launch Bridge and purge cache of the MOV files.
    Please tell me whether the issue is still there.
    Thanks!
    Best Regards,
    Bridge QE
    Chun Xia

  • Inverse Color Dodge not rendering in browser

    I have a blue orange logo on lighter to dark blue gradient.
    In FW the logo looks vibrant and luminous in inverse color dodge
    blending mode. However, when I view in DW, it is too
    dark--identical to normal blending mode. Is this a browser issue or
    something else? I am saving in both png8 and gif with blue
    matte...

    Hi Paevo,
    >I have a blue orange logo on lighter to dark blue
    gradient. In FW the logo
    > looks vibrant and luminous in inverse color dodge
    blending mode. However,
    > when
    > I view in DW, it is too dark--identical to normal
    blending mode. Is this a
    > browser issue or something else? I am saving in both
    png8 and gif with
    > blue
    > matte...
    Gradients need to be exported as jpgs - try that. PNG8s and
    gifs only offer
    256 colors at most.
    Aloha,
    Jerry
    http://MauiWebDesigns.com

  • Why are RAW image thumbnails not being rendered?

    OK. I am not sure that I used the right terminology, but I have noticed that Bridge is no longer rendering (? proper term) the Canon Raw image thumbnails properly in Bridge CS6.
    I shoot RAW and Small JPEGs. I copy the folder of images onto my external hard from my camera and open Bridge. I see thumbnails of both the RAW and JPEGs with a black border around each image. As Bridge reads each image, the black border disappears from each JPEG thumbnail, but not from the RAW thumbnail like it used to do.
    When I click the raw thumbnail once, I get the larger RAW preview image. When I click the larger image and get the loop, the RAW thumbnail then renders and  either the black border disappears from the thumbnail or the corrections made in bridge become visible in the thumbnail.
    When the loop is on the larger preview image, the image in the loop enlarges automatically to 200% and I have to take the time to scale it back to read the image selection at 100%.
    When I do a batch edit of many RAW images in Bridge, I can click done and the small slider in a circle icon appears above the RAW thumbnail, but the thumbnail is not rendered to reflect the correctiuons made to the image.
    This was never an issue before. Bridge was great in reading RAW images at all stages and now it's not.
    Mac OS 10.9.2
    Processor  3.7 GHz Quad-Core Intel Xeon E5
    Memory  16 GB 1867 MHz DDR3 ECC
    Graphics  AMD FirePro D300 2048 MB

    Have you selected Prefer Embedded previews from the toolbar, or is it set to High Quality on Demand, or Always High Quality?
    Have you tried selecting the containing folder, right-clicking and clicking "purge cache for selection"?
    It sounds like you are having problems with the cache. Depending on the number of images you have and the speed of your computer, it might be worth purging the entire cache, but this should be a last resort.

  • Robohelp 9 Adobe Air Browser Based Help not rendering on IIS Server 7.5

    Hello everyone,
    I'm having an issue where the output (Adobe Air browser based help) is not rendering properly on the IIS Server 7.5 that it is published to.
    I have updated the icons in the skin, and when viewed locally the site works fine. When it is published to the webserver the new icons do not show up, and the banner does not render in the new color. The site is using the unipane adobe air browser based help template.
    I've had the dev team restart the webserver twice, and for some reason the flash object simply won't update.
    Anyone else see this before?
    Thanks,
    Jerry

    Hi Jerry
    If memory serves, Browser Based AIRHelp uses Flash elements like FlashHelp does. I recall a few years ago that FlashHelp had the same issues on some servers. Further, if memory serves, the fix was to ask your web server folks to tweak the server by adjusting the MIME types so it will properly serve Flash items.
    Adobe used to have a KB article on this. Unfortunately, time seems to have caused it to evaporate. Grrrrr
    Cheers... Rick
    Helpful and Handy Links
    RoboHelp Wish Form/Bug Reporting Form
    Begin learning RoboHelp HTML 7, 8 or 9 within the day!
    Adobe Certified RoboHelp HTML Training
    SorcerStone Blog
    RoboHelp eBooks

  • ADF components not Rendering on ie9 Browser

    This is a strange behavior , ADF components like ( table , DVT graph ) are not rendering on the ie9 browser ( keep fetching ...) . However , works fine with ie8,Google chrome, firefox .
    Believe some setting is required in my client brower ie9.
    Any idea why not on ie9 ?
    We are on ADF jdev 11.1.1.3.0
    Browser flash plug version : 11.5.502.135
    OS : Windows 7 . 32 bit
    Browser : IE 9

    I faced a similar problem. I added the following line in the jsp page
    <f:view>
    <meta content="IE=8" http-equiv="X-UA-Compatible"></meta>
    <af:document id="d1" title="something">This will make the IE9 work as IE8. And will also not disturb any behavior of other browsers.
    Thanks and Regards,
    Tarun Agrawal

  • Help! Images are not rendering in any browser!

    When online, images are not rendering on any webpage. All other content is fine. Problem is across browsers, BUT, is limited to my user identity. When I create a new user and go online the problem id resolved. I do not want to lose all my user settings. Can anyone think of something I can do to troubleshoot this. Some file I may have deleted, some setting?

    Hi all, I am facing the same problems:
    Im using an UMTS card to connect to the internet.
    On various pages, no pictures are shown. The reason is, that my mobile carrier is using proxies to compress the pictures. Same thing worked fine, before updating to snow leopard. Now the pictures can show up. Safari says, that the pictures were not found.
    I tried the umts card on another computer, it worked fine, so t has to do with the update from Leo to Snow Leo....
    I already deleted the .plist, but it didnt solve the issue.
    Does anybody has an hint or solution??

  • Svg still not rendering

    There have been a few topics about the svg import into Muse.
    I'm still having trouble on my website design. I keep getting the error "unable to generate thumbnail" and when exported to the browser the image doesn't show up.
    Would greatly appreciate any help!
    Using:
    Mac OSX 10.10.
    Safari

    Hi
    in case you stil have this issue, please check this thread SVG files not rendering in Muse

  • SSRS report does not rendering properly in sharePoint 2013

    Hi everyone,
    I'm a newbie with the MSBI development tool, I've tried to create a testing SSRS reports and its layout showed correct when preview them in Visual Studio (2010 and 2012). Then I migrated the report in SharePoint 2013, but the layout do not rendering as I
    expected, some data mix-up on the matrix table
    The Ident on detail data (drill down) does not render properly compare the layout in when preview in Chrome or Visual Studio (SSRS)
    The summation on second matrix table went wide on both browsers compare when preview thereport in Visual Studio
    The export PDF (using the "action" button on the report in the browsers) showed the second matrix table is overlaps the first matrix table.
    This report has 3 main queries (2 for the matrix tables and 1 for the chart) on a Dev environment:
    Window server 2008 R2 with service pack 2
    SQL server 2012 enteprise with service pack 2
    SharePoint 2013 (no service pack) with integrated mode on the report service 
    Visual Studio 2010 development tools
    I'm very appreciate for anyone can provide any solution to solve this issue.
    Thank you so much,
    Dac.
    P.S.: I attached the preview of the report in both browsers (IE & Chrome) and its preview in Visual Studio.
    An update: ... due to the setting space on"snap to grid" default to 20 and I've made the 2nd matrix table overlaps the 1st one, therefore the it showed overlaps when export to PDF file ... it's solved.
    But the Indent on IE and summation still persist in both browsers.

    Hi everyone,
    The PDF's export has been solved due to the 2nd matrix table overlaps on the 1st table. 
    Also, I don't know why the summation (aka Row Total) went wide when data represented on the 2nd matrix table (see previous post on the row named as "Premium over 5000$" on both browser. So I've redesigned the 2nd table as normal table instead of
    matrix table ... and the summation showed correct (it's so weird)
    For the "Indent" issue showed in IE on both drill down of the 1st table and 2nd table which cannot be fixed, and the end user used only IE.
    Could someone can enlighten me please?
    Many thanks.

  • Inserting new row in Table in 11.1.2 from 11.1.1.3 not rendering table!!!!!

    Hey Guys, my status might say noob but i am well seasoned in ADF. We migrated from 11.1.1.3 to the new JDEV 11.1.2. We are doing a test run before we commit to it.
    I noticed the following:
    We have master detail forms that work flawlessly in 11.1.1.3 when we ran the app under 11.1.2 we noticed that any time you try to add a new row to a table the table does not render. The server logs show the action going through and the count goes up one but the table is not rendered anymore it disappears!!!!!!!!!!!!!!
    Now all of this was imported from the 11.1.1.3. all of our tables that have createInsert actions on them are doing this.
    If i drag the tables again and set them up from scratch it seems to work fine. Our issue is we have a good 300 of these tables in different panels and panel collections. we have to do all of that work all over again.
    No errors show in the log. IS THIS A BUG???????????????
    UPDATE: REFRESHING THE PAGE using the Browser Refresh Button Will show the new ROW....... THIS IS NOT GOOOD!!!
    Edited by: user8333408 on Jul 7, 2011 9:23 AM
    Edited by: user8333408 on Jul 7, 2011 9:24 AM
    Edited by: user8333408 on Jul 7, 2011 10:08 AM

    Thanks for the reply.
    The Project was in version 11.1.3 before I migrated. I had the issue above so I migrated to 11.1.1.4 then to 11.1.1.5 then to the New GREAT 11.1.2 to go by the matrix of support The issue is still there.
    Basic Page layout:
    SEARCH-MASTER-PANELTABBED LAYOUT (Hold all the CHILDREN RECORDS)
    PANEL TAB is made of ; SHOW DETAIL ITEM- PANEL COLLECTION- TABLE.
    the panel collection has a toolbar with 2 buttons in it.
    My issue varies:
    Hit create insert==> record count goes up one but the table does not render (it goes all blank even if records existed in it)
    Hit undo budo ==>table still not rendering. (click next on master record then click previous to come back, the table renders correctly.)
    other tables do the following:
    Hit Create insert == > table shows normally and I can enter new record.
    Hit undo ==> table count goes down but table does not render at all anymore.
    for this issue i noticed if i set cache results to false the table works after hitting undo
    IF I CREATE A NEW SHOW DETAIL ITEM and put exactly what the other tabs have in them and use the same layouts and buttons the new table works great!!!!!!!!!!!!???????????????????? WTF?!?!?!?!
    NO ERROR MESSAGES even at finest level are thrown.
    I HAD NO ISSUES IN THE PREVIOUS VERSIONS OF JDEV IS THIS A JSF 2.0 BUG????
    BY THE WAY JDEV 11.1.2 sometimes CRASHES or Hangs when viewing the Binding of Page when you click on Binding straight from the Design view. I have to open the Binding Page separate to view it. FYI
    Edited by: Nottallah on Jul 11, 2011 9:48 AM
    Edited by: Nottallah on Jul 11, 2011 9:51 AM

  • Safari not rendering a page correctly

    A webpage I created in Dreamweaver uses drop down menus that are supposed to display just to the left of the link they drop from. In all other browsers they work correctly, but since the latest upgrade in Safari to 3.0.4 as a part of OS 10.4.11 on my Macbook, they are not rendering correctly. Instead they are appearing much further to the left where it's difficult to move the cursor to them before they disappear. Until I changed the color of the drop downs they were disappearing into the background. Any ideas why Safari is not rendering them correctly? I'd like to keep Safari as my primary browser, but if it won't render my own page correctly, what other pages might it be messing up? Address of the page is http://www.montgomeryschoolsmd.org/schools/woottonhs/ The drop downs are connected to the central column list that has small arrows beside the words. They will probably work correctly for you, but won't for me in Safari. What can I do to fix it?
    Thanks,
    KWolfrey

    Hi,
    I'm running 10.4.11 with Safari 3.0.4 and as far as I can see the menus seem to work just fine here.
    Do you have a custom stylesheet set in Safaris advanced preferences? (Some Safari enhancer applications set one even if you didn't manually set one so double check to make sure.)
    Also, do you use PithHelmet?
    One quick test you can do to help narrow down things is to try Safari in another user account. This will help us to know whether your problem is local to your account or system wide. If you don't have another account you can use System Preferences -> Accounts -> \[+\] to create a test one (and \[-\] to remove it if needed)
    Lastly, I doubt these [errors|http://validator.w3.org/check?uri=http%3A%2F%2Fwww.montgomeryschoolsmd. org%2Fschools%2Fwoottonhs%2F&charset=%28detect+automatically%29&doctype=Inline&g roup=0] have anything to do with your problem since it seems to work fine for me, but you might want to look into them at some point.

Maybe you are looking for

  • Transaction type 148: affiliated company indicator not allowed

    I am trying to create new transfer variant for intercompany asset transfers, but when saving I am getting error AC768 Transaction type 148: affiliated company indicator not allowed'. Interesting, transaction type 148 is not used in any of the existin

  • S/PDIF Output Issue

    I have a Auzentech X-Fi Forte & I'm facing a weird problem. Whenever I play something using the coaxial output via DDL or DTS every now & then the sound blanks out for few seconds while the video/song continues progressing. It doesn't happen when usi

  • Running java program with arguments in Unix

    Hi I am a new newbie to java so pardon if this is too simple for you . This is my scenario. I have a java program which parses an xml and writes a .dat file. I execute this testparser.java in unix environment like this java testparser xml1.xml and it

  • Partial lot creation

    hw to create partial lot? is it related with procurement or prodn or sales or with all?

  • Best 1TB drive to install inside?

    I have a last edition white 20" iMac and really need more space inside it. I have a 750GB external drive already that is bursting. So i figure 1TB inside is the best option. There seem to be problems with firmware on the Seagates. people having to up