Need some help trying to generate thumbnail images from large Jpegs

Hello,
I have some ActionScript 3.0 code, created with Flex that
will load a large JPEG image (say 3000x2000 pixels) that I'm trying
to create a 100 pixel thumbnail. I have the code working where I
generate the thumbnail, but it's not maintaining the aspect ratio
of the original image. It's making it square, filling in white for
the part that doesn't fit.
I've tried just setting the height or width of the new
image, but that doesnt render well, either.
To see what I'm talking about, I made a screen shot, showing
the before image, and the rendered as thumbnail image:
http://www.flickr.com/photos/taude/533544558/.
Now, there's a few things important to note. I'm saving the
thumbnail off as a JPEG. As you can see in my sample application,
the original renders fine with the proper aspect ratio, it's when
I'm copying the bytes off the bitmapdata object, where I need to
specify a width and height, that the trouble starts. I've also
tried using .contentHeight and .contentWidth and some division to
manually specify a new bitmapdatasize, but these values seem to
always have NaN.
private function makeThumbnail():void{
// create a thumbnail of 100x100 pixels of a large file
// What I want to create is a a thumbnail with the longest
size of the aspect
// ratio to be 100 pixels.
var img:Image = new Image();
//Add this event listener because we cant copy the
BitmapData from an
/// image until it is loaded.
img.addEventListener(FlexEvent.UPDATE_COMPLETE,
imageLoaded);
img.width=100;
img.height=100;
img.scaleContent=true;
img.visible = true;
// This is the image we want to make a thumbnail of.
img.load("file:///C:/T5.jpg");
img.id = "testImage";
this.addChildAt(img, 0);
private function imageLoaded(event:Event):void
// Grab the bitmap image from the Input Image and
var bmd:BitmapData =
getBitmapDataFromUIComponent(UIComponent(event.target));
//Render the new thumbnail in the UI to see what it looks
theImage.source = new Bitmap(bmd); //new Bitmap(bmd);
public static function
getBitmapDataFromUIComponent(component:UIComponent):BitmapData
var bmd:BitmapData = new
BitmapData(component.width,component.height );
bmd.draw(component);
return bmd;

Dev is 10gR2 and Prod is earlier version of Oracle, 10gR1.
The schema (or table(s)) export file created by Oracle Database Control in Oracle 10gR2 is not importable into 10gR1, by default.
Workaround.
Use the Schema (table(s) export wizard of in the Maintenance section
of the Oracle Database Control in ver 10R2,
but when you get to the end of the wizard (I recall Step 5),
show the data pump export source PL/SQL code, cut and past to editor,
and find the variable where you can set the Oracle database version
to your prod database version,
then run the script from the SQL Plus prompt in 10gR2 dev,
and this creates an Oracle 10gR1 compatible data export file.
Then go to Prod and run the schema (table(s)) import data wizard,
and import the export file. You will have to option to move the data
to another schema or tablespace if required.
Just to not run into troubles, I use the same schema and tablespace name
in both dev and prod.
the variable you must modify in the 10gR2 datapump export script looks like
h1 := dbms_datapump.open (operation => 'EXPORT', job_mode => 'SCHEMA', job_name => 'ExportTableToProdJob', version => 'COMPATIBLE');
and you must change manually to
h1 := dbms_datapump.open (operation => 'EXPORT', job_mode => 'SCHEMA', job_name => 'ExportTableToProdJob', version => '10.1.0.1');
This creates a 10g1.0.1 or later compatible export data file.
You must have read/write privileges to the folder were the export data file will be created, and imported from. (Oracle Directory Object)

Similar Messages

  • Need some help how to generate xml from java bean.

    Hi,
    Can some one help me how to generate the xml format output from a java bean.
    The bean contains around 15 to 20 attribute values.
    Thanks in Advance.
    sarayu

    You can use XMLEncoder with custom persistence delegates if needed:
    http://java.sun.com/products/jfc/tsc/articles/persistence4/

  • Need some help trying to repair network connection.

    Let me start this off by letting you folks know that I am in no way well-versed with any type of Networking or anything of the sort. A friend of mine set up my personal wireless network at my house. Ok, I'll try to keep this concise. I read through the FAQ and used a few of the troubleshooting guides, but to no avail. First, let me illustrate my home network. We have a PC downstairs that is directly connected to our modem (Westhill is the brand, I believe) and we use Verizon DSL. My wireless router (WRT54G v5) is connected to the internet through that modem. There is another PC upstairs (mine) that is connected to the internet using a wireless adapter (WMP54G) I also have a notebook that is connected to the internet using its internal Wifi... thing.
    About a week ago, the internet stopped transmitting to our upstairs pc. We tried repairing the connection using windows and connecting to other surrounding (unsecured) wireless networks, and it would not connect. My notebook, however, can still connect to these outside networks, but not our personal, secured network. As far as I know, our wireless network has a WEP 128-bit encryption.
    For the life of me, I CANNOT figure out how to fix this! When I bring up the Linksys Wireless Network monitor, the Link Information says that it "Cannot associate with the Access point", and sometimes will state that It CAN associate with the access point, but no internet can be found.
    If you can help, or even point me in the right direction I would be eternally grateful!
    FYI: The cables are all connected correctly and the Internet and WLAN lights on the router are all lit. Isn't that great?

    Another piece of info that may help get some answers brewing: When we exhausted all measures known to us, we reset the router thinking that maybe that would help. It didn't though, it just made it worse and more confusing. Thanks again!

  • HT1349 It's impossible to contact anyone from Apple helpdesk. You get sent from pillar to post only to hit a brick wall. I need some help as my Audiobooks have disappeared from my library. Been trying for 2 days to get help but can't get through to anyone

    Apple help service is crap. I've been trying to contact someone for 2 days now and can't get through to anyone. My audiobooks have disappeared from my Library - I paid a lot of money for these! None of the 'contact us' buttons get me through to anyone, you get sent electronically from pillar to post and end up hitting a brick wall.What a disgusting service - they can't even design a simple way of contacting them. I thought microsoft were bad but Apple are even worse!

    the thing is i never threw away the project plus i have a copy of it lol... it has something to do with me moving the folder im just sure of it. because when i checked the trash when i tried to delete that new folder, its there.... thats the only thing i deleted from the event library window. then the other projects that were useless that i threw away. should i restore those? i havent emptied my trash.
    also i could never find where it saves everything... so i just did a search... (im not a very techy guy) plus im unsure how to back it up... if its a feature in the program then i havent figured it out yet...
    but i think if i put the "final cut projects" folder back where i took it from it should be fine. im THINKING thats the case. the only problem is i dont know where i got it from. sounds silly i know but i found the folder from doing a search in finder.

  • Need some help trying to resolve some game crashes.

    Forgot to list OS in SIG.... anyway I am running XP pro.
     What I am getting is hard locks during some (not all) games (Farcry and Rise of Nations are the worst). Anyway I get a God awful high pitched squawk out of my speakers and the games hardlock my system and can only be corrected by resetting or killing power.
    Do you guys think the culprit is the soundcard, platform or the software itself?
    Are there known issues with any of my current hardware FIS2R?
    Ive got all the latest drivers for my hardway and my board bios is the most current 1.5 I think. One thing of note with the Audigy 2 I have not installed all the creative bloatware I kept it simple and just installed the drivers pretty much the same with my 9800 just the drivers and controll panel.
    My boot is pretty clean with just the ATI controll planel icon. bellsouth internet accelerator, volume controll, and the icon that keeps insisting I call MS to authorize my version of XP PRO for the 50th time (those people are gonna start avoiding my phone calls)

    I also had problems with my Athlon 64, similar to yours. Your problem is probably the sound card or the PSU (if the PSU is OK it should run, my Athlon 64 is very stable whatever I do with it after I took the Audigy 2 out (and I only have a +12 15A PSU)). So, my advice is take out the Audigy 2 ZS and use the onboard sound for now. If the problems persist, then it probably is the PSU and not the sound card. People with AMD Athlon 64 seem to run OK with something like Hercules GameSurround Fortissimo 3, so if you want better sound get that.
    PS: I good PSU is ENERMAX EG465P-VE(FM).

  • HT201263 i need some help trying to reset everything on my ipod but i dont know how and it wont let me do anything because it said that it is disabled and connect to itunes

    it wont let me do anything but just let me look at the screen and it saying ipod disabled connect to itunes

    Disabled
    Place the iOS device in Recovery Mode and then connect to your computer and restore via iTunes. The iPod will be erased.
    iOS: Wrong passcode results in red disabled screen                         
    If recovery mode does not work try DFU mode.                        
    How to put iPod touch / iPhone into DFU mode « Karthik's scribblings        
    For how to restore:
    iTunes: Restoring iOS software
    To restore from backup see:
    iOS: How to back up     
    If you restore from iCloud backup the apps will be automatically downloaded. If you restore from iTunes backup the apps and music have to be in the iTunes library since synced media like apps and music are not included in the backup of the iOS device that iTunes makes.
    You can redownload most iTunes purchases by:
    Downloading past purchases from the App Store, iBookstore, and iTunes Store        

  • Extracting some content and rollup or thumbnail image from article

    Hi,
    As content query web part doesn't do horizontal display, I am writing some c# code to accomplish this. I have a subsite which contains article pages with images. I am trying to extract a part of the content as a the summmary and display the associated image
    at the top of the summary. Any ideas of what code I could use to accomplish this? At the moment, my code includes the following which allows me to get the name of each article page.
    SPWeb oWeb = SPContext.Current.Site.OpenWeb("news2");
               oWeb.Lists.IncludeRootFolder = true;
                SPList oList = oWeb.Lists["pages"];
               SPFolder oFolder = oList.RootFolder;
               SPQuery oQuery = new SPQuery();
               oQuery.Folder = oFolder;
               SPListItemCollection collListItems = oList.GetItems(oQuery);
               foreach(SPListItem oListItem in collListItems)
                   HttpContext.Current.Response.Write(oListItem.File.Name + "<BR>");
    Sherazad

    Hi Sherazad,
    What do you mean by horizontal display?  you can create content search webpart and customize the display template and item display template to view the content in any format you want.
    check the below post
    http://en.share-gate.com/blog/roll-up-sharepoint-2013-sites-using-search
    but instead of targeting the query to subsites target the query to your list using the managed property PATH:http://sitecollection/lists/news2/* or ListID:your_list_id 
    Amr Fouad Head of Consulting Blog: http://sharepointtweaks.blogspot.com https://paper.li/amr_m_fouad/1401229504 Twitter: @amr_m_fouad Linkedin: https://www.linkedin.com/in/amrfouad

  • Not a genius i need some help

    my husand received a ibook from a customer as a form of payment for some work he did. It works but need some help trying to figure out some things any help will be appreciated. We received it with a admin password so i rebooted it with my new mac os x 10.5.4 to set our own admin password. I can connect to internet with my cable modem no problem however it will not let me open yahoo! it says not a supported browser so i click safari 5 to download and it then tells me that bill of materials is missing any ideas? when i load my mac os x disk it will not load just spins in tray all cds work so dont know why it won't run. It occassionally tells me that classic doesnot have mac os 9 supported?Also any updates i need from this info would also help me out. thank you.
    mac os x version 10.3.9 processor 300 mhz PowerPc G3/powerPc 750 (83.2) memory 192 MB L2 Cache 512 kb bus speed 67 Mhz boot rom version 3.2.4f1
    ata-4 bus: Toshiba 5.59GB revision N2.10c OS9 drivers:Yes
    Safari 1.3.2
    I hope any of this helps. Not really wanting to invest alot of money to do modifications just want to be able to do simple tasks like:itunes check email etc

    HI and welcome to Apple Discussions...
    Try repairing permissions.Launch Disk Utility. (Applications/Utilities) Select MacintoshHD in the panel on the left, select the FirstAid tab. Click: Repair Disk Permissions. When it's finished from the Menu Bar, Quit Disk Utility and restart your Mac. If you see a long list of "messages" in the permissions window, it's ok. That can be ignored. As long as you see, "Permissions Repair Complete" when it's finished... you're done. Quit Disk Utility and restart your Mac.
    And since you don't the original install disc, boot in Safe Mode to make sure the startup disk is ok.
    Instructions for starting up in Safe Mode
    What is Safe Mode
    It occassionally tells me that classic doesnot have mac os 9 supported?
    The original owner probably had the Classic environment installed (Mac OS 9).
    For software updates, click the Apple Menu / Software Update...
    Carolyn

  • Need some help with Substring

    hi all
    i am writing a simple program and got stuck at one point
    this is how it goes:
    public static static main(String[] a) {
    for (int i=1; i<a.length; i++){
    System.out.print(a[i]+",");
    so if i entered "a ab abc" this becomes "a,ab,abc,"
    the problem is that i NEED to use substring to get rid of the last comma, how can i take the already print out result as a whole new string?? or i need to rewrite it in another way??
    i really need some help, thanks in advance
    B

    You start from index 1, skipping the first element in the a-array, is that what you want? Otherwise you should loop from 0.
    Anyway, here is how you can do it (skipping first element as you did):
    for (int x = 1; x < a.length; x++) {
      System.out.print(a[x]);
      if (x < a.length-1)
        System.out.print(",");
    }You can't remove what you have already printed out. Another way to do this, is with a StringBuffer:
    StringBuffer sb = new StringBuffer();
    for (int x = 1; x < a.length; x++) {
      sb.append(a[x]);
      if (x < a.length-1)
        sb.append(",");
    String s = sb.toString();
    System.out.println(s);

  • I need some help resizing my images on PS6. I am using a mac and have been trying to resize with same resolution and constaining proportions but for some reaseon the smaller resized image appears pizelated.

    I need some help resizing my images on PS6. I am using a mac and have been trying to resize with same resolution and constaining proportions but for some reaseon the smaller resized image appears pizelated. Heres an image of before and after. The first image I use is a JPG 72dpi 1500px x1500px and I want to downsize it to 600x600px same res, but it keeps pixelating, this has never happened before. Any suggestions, thoughts?
    thanks!

    I wouldn't say pixelated; more like blurry.
    Like ConnectedCreative said, what steps are you using? Are you using "bicubic sharper" when resizing down?

  • Trying to make a photo contest need some help

    Trying to make a photo contest need some help. I am running a
    fish photo contest on my website and was wondering if any of you
    could give me some advice on some good extensions to help me do
    this easier. Basically I want a page where people upload a file and
    then it automatically resizes the image and puts it on a page,
    where people can vote on the pictures.

    Hi Pilot,
    Column B contains the sale amounts.
    Column C will contain the tax amounts.
    I'm assuming a header row, and the first line of data to be row 2.
    In C2, enter: =B*20%
    Click Accept, then use the mouse to drag the small round handle at the lower right of the selected cell (C2) to fill the formula into the rest of the cells in column C.
    This simple version of the formula will put zeros in all column C cells where no amount has been entered in the corresponding cell in column B. The revised formula below takes care of that.
    C2: =IF(B,B*20%,"")
    I'd strongly suggest that 'rookies', as you describe yourself, download and read both the Numbers User Guide and the Functions and Formulas User Guide. Both are available from the Help menu in Numbers. If you use Pages and Keynote, you should use the Help menu in those applications to download their User Guides as well. The guides are searchable pdf files, well written, easy to read, and useful to rookies and old hands as well.
    Regards,
    Barry

  • Need help to show a thumbnail image column in report

    Hi, Gurus:
    I need to display a column of thumbnail images in a classical report. I follow the thread https://kr.forums.oracle.com/forums/thread.jspa?threadID=2201667
    I am using APEX 4.1, Oracle 11gR2
    Here is my table:
    CREATE TABLE "SORS"."SOR_IMAGE"
       (     "IMAGE_ID" NUMBER(10,0),
         "OFFENDER_ID" NUMBER(10,0) NOT NULL ENABLE,
         "IMAGE" BLOB CONSTRAINT "SOR_IMAGE" NOT NULL ENABLE,
         "THUMBNAIL" BLOB,
         "MIME_TYPE" VARCHAR2(50 BYTE),
          CONSTRAINT "SOR_IMAGE_PK" PRIMARY KEY ("IMAGE_ID")
    )Here is my procedure:
    create or replace
    procedure dl_sor_thumbnail (p_offender_id IN NUMBER) as
       v_mime_type VARCHAR2(48);
       v_length NUMBER;
       v_name VARCHAR2(2000);
       v_image BLOB;
    BEGIN
      SELECT 'IMAGE/JPEG', dbms_lob.getlength(thumbnail), thumbnail
      INTO v_mime_type, v_length, v_image
      FROM sor_image
      WHERE offender_id = p_offender_id
      and image_id = (select max(image_id)from sor_image where offender_id = p_offender_id) ;
    -- setup the HTTP headers
    owa_util.mime_header(nvl(v_mime_type, 'application/octet'), FALSE);
    htp.p('Content-length: '||v_length);
    --htp.p('Content-Disposition: attachment; filename="' || substr(v_name, instr(v_name,'/') + 1) || '"');
    --htp.p('Content-Disposition: attachment; filename="'somemmmmmfilename.jpg'");
    -- close the headers
    owa_util.http_header_close;
    -- download the Photo blob
    wpg_docload.download_file (v_image);
    END dl_sor_thumbnail;here is my report:
    select distinct 'MAP', '<img src="#OWNER#.dl_sor_thumbnail?p_offender_id='||so.offender_ID||'"/>' detail,
    so.doc_number as "DOC Number", so.offender_id as "Offender_ID", so.first_name||' '|| so.middle_name||' '||so.last_name as "Offender Name",
    so.checksum as "checksum",
    so.last_name as "Last Name",
    so.first_name||' '|| so.middle_name as "First Name",
    (select sc1.description from sor_code sc1 where sc1.code_id=so.race) as "Race",
    (select sc2.description from sor_code sc2 where sc2.code_id=so.sex) as "Sex",
    (select sc8.description from sor_code sc8 where sc8.code_id=so.hair_color) as "Hair Color",
    (select sc9.description from sor_code sc9 where sc9.code_id=so.eye_color) as "Eye Color",
    replace(replace(nvl2(sl.address1, sl.address1||' '||sl.address2 ||' '||sl.city ||' '||sl.county||' '||(select sc3.description from sor_code sc3 where sc3.code_id=sl.state)||' '||sl.zip, '-'),'#'),',') as "Address",
    replace(replace(nvl2(sl.physical_address1,sl.physical_address1||' '||sl.physical_city ||' '||sl.physical_county||' '||(select sc4.description from sor_code sc4 where sc4.code_id=sl.physical_state)||' '||sl.physical_zip, '-'),'#'),',')  as "Physical Address",
    sl.status as "Status",
    to_char(sl.ADDRESS1_LATITUDE) as "Address Latitude",to_char(sl.address1_longitude) as "Address Longitude",
    to_char(sl.physical_address_latitude) as "Physical Latitude",to_char(sl.physical_address_Longitude) as "Physical Longitude",
    decode(rox.habitual, 'Y', 'Habitual', '') as "Habitual",
    decode(rox.aggravated, 'Y', 'Aggravated', '') as "Aggravated"
    from sor_location sl, sor_offender so, registration_offender_xref rox, sor_last_locn_v sllv
    where rox.offender_id=so.offender_id
    and sllv.offender_id(+)=so.offender_id
    and sl.location_id(+)=sllv.location_id
    and rox.status not in ('Merged')
    and rox.REG_TYPE_ID=:F119_REG_ID
    and upper(rox.status)='ACTIVE'
    and nvl(rox.admin_validated, to_date(1,'J'))>=nvl(rox.entry_date, to_date(1,'J'))
    and (((select sc11.description from sor_code sc11 where sc11.code_id=so.race and sc11.code_id=:P5_SL_RACE) is not null ) or (:P5_SL_RACE is null))
    and (((select sc12.description from sor_code sc12 where sc12.code_id=so.sex and sc12.code_id=:P5_SL_SEX) is not null ) or (:P5_SL_SEX is null))
    and (((select sc13.description from sor_code sc13 where sc13.code_id=so.hair_color and sc13.code_id=:P5_SL_HAIR_COLOR) is not null ) or (:P5_SL_HAIR_COLOR is null))
    and (((select sc14.description from sor_code sc14 where sc14.code_id=so.eye_color and sc14.code_id=:P5_SL_EYE_COLOR) is not null ) or (:P5_SL_EYE_COLOR is null))
    and (exists ( (select sm.offender_id from sor_mark sm, sor_code sc15 where sm.offender_id=so.offender_id and  sc15.code_id=sm.code and sc15.code_id=:P5_SL_OTHER_MARKS  and sm.description is not null) ) or (:P5_SL_OTHER_MARKS is null))
    and ((exists (select sm1.description from sor_mark sm1 where sm1.offender_id=so.offender_id and upper(sm1.description) like upper('%'||:P5_TF_OTHER_MARKS_DESCRIPTION||'%'))) or (:P5_TF_OTHER_MARKS_DESCRIPTION is null))
    and ((floor(to_number(sysdate-so.date_of_birth)/365)-:P5_TF_AGE between -5 and 5) or (:P5_TF_AGE is null))
    and ((to_number(:P5_TF_HEIGHT_FEET)*12+to_number(nvl2(:P5_TF_HEIGHT_INCHES, :P5_TF_HEIGHT_INCHES, '0')-(floor(so.height/100)*12+mod(so.height, 100))) between -6 and 6) or (:P5_TF_HEIGHT_FEET is null))
    and ((so.weight-:P5_TF_WEIGHT between -25 and 25) or (:P5_TF_WEIGHT is null))and I set detail column as standard report column.
    however, the report shows no image, just an icon which indicates the image is not available. Would anyone help me on this problem?
    Thanks a lot.
    Sam
    Edited by: lxiscas on Apr 16, 2013 1:59 PM

    lxiscas wrote:
    I need to display a column of thumbnail images in a classical report. I follow the thread https://kr.forums.oracle.com/forums/thread.jspa?threadID=2201667
    Bad choice. Only one person involved in that thread knew what they were doing...and you copied from the wrong one.
    Here is my procedure:Lose it. Custom download procedures are overcomplicated and now almost never required.
    See the recommendation to use declarative BLOB support, as shown in the Thumbnail image problems.

  • Have been trying to get a simple rollover tooltip going but haven't had any success...need some help

    Have been trying to get a simple rollover tooltip going but haven't had any success...need some help please

    start watching at 11min
    http://www.youtube.com/watch?v=6_FJYN36_94
    hope this helps

  • The backup disk image "/Volumes/Data/David Witkowski's Mac Pro.sparsebundle" is already in use.  Whenever Time Machine starts to backup to Time Capsuel I get the previous error message. I need some help to fix this.

    The backup disk image “/Volumes/Data/David Witkowski’s Mac Pro.sparsebundle” is already in use.  Whenever Time Machine starts to backup to Time Capsuel I get the previous error message Where can I find this disk image?. I need some help to fix this.
    Thanks,
    David W

    There are multiple answers and solutions if you look just to the right under the heading of More Like This.

  • I need some help. im getting error -69 when trying to sync my ipod. i dont kno what to do. ive tried googling as much info as i can on this but i cant seem to find a answer to get me off to a good starting point. i back all my music up on a hard drive.

    i need some help. im getting error -69 when trying to sync my ipod. i dont kno what to do. ive tried googling as much info as i can on this subject but i cant seem to find a answer to get me off to a good starting point. i back all my music up on a external hard drive.

    If the file was not originally from iTunes, you'll need to redownload it from it's original source or rerip it from the CD.  Files can sometimes go bad and become corrupted.  As to how or why that happens, there are a number of ways.
    What format are the problematic tracks in? Have you tried converting them to another format in iTunes?
    iTunes: How to convert a song to a different file format
    B-rock

Maybe you are looking for