How can to resize an image uploaded in to the smart image

Hi
    I have an image uploaded into the smartimage from the local file system. How can i resize this file or create a rendition for this image?
Thanks
Veena

Hi
   I got a reference for the same question from Stack Overflow http://stackoverflow.com/questions/14726485/resize-an-image-resource-in-cq5/16728970#16728 970
I tried the same method
Resource resourceNew = resource.getResourceResolver().getResource(img.getFileReference());
    Asset asset = resourceNew.adaptTo(Asset.class);
    log.error("asset ****" + asset);
    Layer layer = new Layer(asset.getOriginal().getStream());
    layer.resize(200, 200);
    log.error("layer ****" + layer);
                        Image image = new Image(resource);
    String mimeType = image.getMimeType();
    ByteArrayOutputStream bout = null;
    ByteArrayInputStream bin = null;
    try {
        bout = new ByteArrayOutputStream(2048);
        layer.write(mimeType, 1, bout);
        bin = new ByteArrayInputStream(bout.toByteArray());
        asset.addRendition("resizedImage", bin, mimeType);
log.error("asset Bin" + asset);
    } finally {
        // close streams ...              
Where img is my Image object and I was able to create a rendition in the dam.
But the rendition I am getting is in File format. Is there a way by which i can change it to png format??? any Help will be appreciable..
Thanks
Veena

Similar Messages

  • How can I resize a JFrame ,to fit into the screen size

    I have a Jframe which has JPanel and JPanel contains lot of other components.JPanel size is 980,1400. when i use JFrame.show method jpanel goes beyond the screen size in length and I am not able to see the portion below the screen.How can I resize the JFrame so that JFrame and JPanel shrinks to fit into the screen size.I need this because I have a PRINT button at bottom of the JPanel.Thanks.

    Thank you for your reply.I tried with the following code as you have told.But the frame is still going beyond the screen.Can you please look into it and tell me whats wrong ?
    //public class PlayerRegForm extends javax.swing.JFrame implements Printable
    public static void main(String args[]) {
    PlayerRegForm prf = new PlayerRegForm();
    Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
    Dimension frameSize = prf.getSize();
    if (frameSize.height > screenSize.height)
    frameSize.height = screenSize.height;
    if (frameSize.width > screenSize.width)
    frameSize.width = screenSize.width;
    System.out.println("Screen Size ----------------- " + screenSize);
    System.out.println(" Frame Size ----------------- " + frameSize);
    prf.setSize(frameSize.width, frameSize.height);
    prf.pack();
    prf.show();
    =============================================================================
    Screen Size ----------------- java.awt.Dimension[width=1024,height=768]
    Frame Size ----------------- java.awt.Dimension[width=112,height=28]

  • How can I Resize Two or More Shapes At The Same Time?

    I've got text over a rectangle over another rectangle. When I change my text, the size of the boxes needs to change and it's a drag ot have to do each one separately and constantly realign. Is there a way I can resize both of them at the same time tokeep the proportions the same?
    Or is there a way I can enter #s to resize, so I could just enter the same #s for each shape?
    Thanks,
    Amanda

    Here's an example of what Wyodor is referring to: text in shapes within another shape.. It goes one step further and adds the first shape+text into another shape but the concept is the same.
    OT

  • How can I stop it from uploading and clear the queue?

    I'm having a hell of a time uploading these photos to my picasa account. After several attempts to get it working, it is now upload all 1,000+ photos and videos about 4 times. It's been going for almost 24 hours now and I just want to cancel and start over. Right now I can only pause uploading but I can't clear the queue. Any help would be greatly appreciated. Thanks.

    I have to agree the reply came off a bit condesending. People are at all different level of tech competency and that is no reason to make others feel badly. Most of the people on the board are kind and helpful but others.
    That's one thing I love about Major Geeks online they are always helpful and you can ask a "foolish" question and never made to feel badly by the people who are members and are just donating time to help others... it's really nice!
    I don't automatically update for a month I want to make sure all the bugs are out and find out if there are any problems. I have dyslexia and do not always have time to get through all the information. The new rules and regulations is pages and pages long. And trying to read it on my Iphone 4s was awful. I finally gave up and just agreed. I am not concerned about Youtube as I am losing Google maps. It's not like they put Mapquest in, which is what I always check after Google to see if there is a better way to get where I am going.

  • How can I resize an image without losing resolution or using the crop tool? I am using Photoshop Elements 13 on a PC.

    How can I resize an image without losing resolution or using the crop tool? I am using Photoshop Elements 13 on a PC.

    Hi Peru Bob,
    I've tried two images, the results were:
    Image 1
    Jpg, original file size 923KB, dimensions 848px x 279px.
    After resizing to 848px x 180px with 72dpi, the file size decreased to 164KB.
    Image 2
    Jpg, original file size 809KB, dimensions 1200px x 1800px.
    After resizing to 668px x 722px with 72dpi, the file size decreased to 307KB.
    So, there seems to be a fair file size loss - is this to be expected?

  • How can I resize my image?

    How can I resize my image to be smaller?

    You asked about changing the file size
    To change the size in Pixels, you use the options at Size in the export dialogue
    Regards
    TD

  • I am trying to send a file for a contest and my image is 2.7MB and they only want it 2MB how can I resize my image to fit ?????

    i am trying to send a picture on a pastel site for a contest and my image is 2.7MB........ they want it 2MB...how can I resize my photo to 2MB???? Pat....

    select the photo and export it (file menu ==> export) - there are several options for reducing the size including quality and maximum pixel dimension
    LN

  • How can i resize my image after image trace?

    Hello all!
    I'm just now getting into using illustrator (currently on trial for illustrator cc) and I've taken a couple of my illustrations and attempted to use the image trace. The only way I can seem to get the image trace to actually produce an accurate trace is if I use a very large file size. So I take my scanned image (600 dpi 2000x 1891) and load it into illustrator, and here's where the problem comes in. Illustrator will not show my entire image on the screen. I zoom out as far as I can go and it's still cutting off the bottom and top of the image. When I try to scale the image it won't let me scale it down to even 90%.
    So my question, is there anyway I can load my full size image into illustrator, image trace it, and then scale it down so I can see the whole image on my screen? It's very hard to paint and work around the image when it's getting cut off.
    The first picture is what the whole picture looks like, but it's such a small file size it's blurry and won't image trace correctly.
    The 2nd image is what happens when I load my full image size in, I'm scrolled as high as the page will go and the top is still cut off.

    Hope this helps Trevor.
    There are other ways of doing this, but try this one.
    Menu - ‘Select all’
    Object - ‘transform’ - ‘scale’
    Dialogue box - click ‘uniform’ add number 1% to 100%, your choice
    Options - tick ‘scale stroke & effects’
    tick ‘preview’ to see results

  • How can I start anew with Photos and clear the (minimal) stuff it has uploaded

    I've about had it up to here with this new Photos scheme. I reorganised my Aperture libraries on both my iMac and MBA in preparation for this, delayed turning Photos on for a couple of days until I thought everything was ready based upon the limited advice that was out there, and then got stuck in an endless loop of "uploading" and "preparing" every time I opened Photos. There are 19,975 images in my Aperture library on the iMac. I was stuck at Uploading at anywhere between that number and 19,000 with no progress after hours of waiting. I tried all the tricks mentioned here including re booting, restarting the app, repairing/rebuilding the database, killing the "cloudd" process, etc.today Today when I restarted Photos, it now said I had 23,775 images to upload- 4000
    more than I have-and of course it got stuck there, like it has for the last week.
    I copied the previous Aperture library (pre Photos migration)back to my iMac and opened it in Aperture. Thankfully, all the photos I had taken on my iPhone this week during this Photos clusterphuck transition were in the Aperture Stream so I didn't lose any of those. I'm willing to give this whole thing one more shot. So  i need some advice. How can I start anew with Photos and clear the (minimal) stuff it has uploaded (about 6000 of 19,000 images in the last 7 days) ? If I simply delete the Photos.photolibrary file will that do the trick and lt me start a new fresh library using?
    <Re-Titled By Host>

    How can I start anew with Photos and clear the (minimal) stuff it has uploaded (about 6000 of 19,000 images in the last 7 days) ? If I simply delete the Photos.photolibrary file will that do the trick and lt me start a new fresh library using?
    It is hard to say from your post, why the migration did not succeed in your case.
    by "stuck on upload" do you mean, you opened the Aperture library in Photos, and Photos converted it to a Photo Library, and then the upload to iCloud Photo Library did hang?  Or did already the upgrade to the Photo Library fail?
    If you want the Aperture library to upload to iCloud Photo Library, it needs to be on a disk formatted MacOS Extended (Journaled) and the original image files must not be referenced. Referenced originals will not upload.
    Also, the upload may hang, if you do not have enough free iCloud storage, orr if one of the videos or photos in your library is in an unsupported format or corrupted.
    To start over, try to repair and rebuild the Aperture library before opening it in Photos. Try all Aperture Library First Aid options - starting with repairing the permissions.  (Repairing and Rebuilding Your Aperture Library: Aperture 3 User Manual)
    If I simply delete the Photos.photolibrary file will that do the trick and lt me start a new fresh library using?
    You will have to delete the photos that are already in icloud too; otherwise you are risking duplicates.
    Can you launch Photos at all?  If yes, delete all photos in Photos and empty the Recently Deleted album. Wait for the deletion to sync to iCloud. Then delete the Photos.photolibrary.

  • How can I resize a photo in iPhoto without cropping it?

    I am taking pictures on my iphone 4s and using iphoto to edit them on macbook pro.  I need to upload these photos at a size much smaller than what i am able to take with my phone.  The only way I see to adjust the size of a photo in iphoto is to crop it.  How can I resize without cropping?
    Thank you

    It's an option in the Export menu.
    File -> Export and under the Size option you can choose the maximum you prefer. Export that and upload from the desktop.

  • How can I allow a user (client) to choose a local image file (on his hard d

    How can I allow a user (client) to choose a local image file (on his hard drive) and modify it using an applet from his browser ? I am trying to develop a web page that enables the user to choose an Image file, manipulate the image using a java applet, and display the results.
    Using Java�s �JFileChooser� does not work when called from a browser, probably due to security privileges issues. On the other hand, I can choose and upload any file using a JavaScript form:
    <FORM METHOD="POST" ENCTYPE="multipart/form-data" ACTION="process.asp">
    <INPUT TYPE=FILE NAME="file1"><BR>

    It seems that I can choose an image file with a Java script form and process an image with an applet. How can I choose a file AND process it locally ?
    (I do not wish to upload the file to the server using JavaScript form and then back to the client�s applet for processing since it will be a tremendous waste of resources).
    Will appreciate any solution.
    Thanks !
    ( my email is: [email protected] )

    "Using Java�s �JFileChooser� does not work when called from a browser, probably due to security privileges issues. "
    You can do this if you sign the applet...

  • How can I resize partition? - New larger hard drive installed

    Hello,
    The hard drive on my MacBook Pro recently died on me (just past my Apple Care warranty - lucky me).  I sent it to an authorised reseller/repair place and they installed a new hard drive for me - replacing my old 250GB with a nice new 500GB.  The problem is when they copied over the disk image from my previous hard drive they did not scale up the image (yeah, not so happy bout that).  Now I find myself with a 500GB hard drive with a 250GB partition called Macintosh HD and 250GB of unused/unusable space.  On top of that I'm just starting to get messages saying boot disk nearly full.  How can I resize the "Macintosh HD" partition to use the entire disk?  I've tried using disk utility, clicking on the main drive, going to the partition tab and dragging the Macintosh HD partition to use the entire disk but after a few seconds of a message saying "waiting for disk to reappear" it returns to the same 250GB size.  Running OSX 10.9.3.  Any suggestions?
    Thanks all!

    See the tips in pounding's section on using Disk Utility:http://pondini.org/OSX/Home.html and you could also take the route of buying an external hard drive (a great idea of maintaining a backup), format that drive for Mac OS X Extended (Journaled), clone the startup disk to that drive, then boot from the external, erase and format the internal, then clone the external back to the internal partitioned as you want.

  • HT1212 I am trying to restore a phone that the screen does not work on, therefore I can't input my password.  How can I bypass this and upload it to itunes?

    I am trying to restore a phone that the screen does not work on, therefore I can't input my password.  How can I bypass this and upload it to itunes?

    You could follow the instructions in the support document that you linked from. There is a section regarding the passcode and the inability to use it or enter it. However, you may encounter more issues since you cannot use the screen.

  • How can i NOT include top level keyword in the metadata of an image?

    Hello,
    I want to know how can i NOT include top level keyword in the metadata of an image. I know there is an option for not applying a keyword to an exported image, but is there an option for not applying the top level keyword to the actual image?
    I have organized my geographical (by location) keywords like this:
    Places
    USA
    New York
    Miami
    Spain.
    If i add geographical keywords to all my images, all my images will have the keyword "Places", i dont think that it have any sence to have all your images with one keyword. How can i fix this? Any sugestion? i will appreciate it a lot any help or information that you could give me.
    Excuse my english, i know it is not good. I hope that you could understand me.
    Thanks,
    Marcelo :)

    Explicitly excluding a keyword only applies when "exporting". Unfortunately, there's currently no way to stop the keyword being written to the file when "Save Metadata to File" command is used. The natural reaction of users to this difference is to suggest that it is stupid. Nevertheless, there are good reasons why the difference exists:
    1. "Export" creates a new file whereas "Save Metadata to File" writes the metadata back into the existing file.
    2. There are very good reasons why certain keywords should not be written to file, and the example given in the OP is one. Saving metadata to file is more often used as means of backing up important image related metadata, independently of the catalog or allowing the metadata to be visible in other aplications. It would be rare that such a file would be shared with a third party, so the reason for not including certain keywords is less obvious. Actually, not including it can result in no end of confusion and grief. For example, if the top level (or any keyword) was excluded during the save metadata process then the other keywords would be orphaned when image is imported back into the catalog (e.g. buiding a new catalog).
    The development team are aware of the need, in some circumstances, to exclude certain keywords when save metadata command is used. How and when the issue is resolved, without adding even more confusion/complexity, is some way off.

  • How can I resize a pdf page content with annotations and highlights in Acrobat Pro?

    How can I resize a pdf page content with annotations and highlights in Acrobat Pro while maintaining page size and annotation/highlight interactivity? I've tried to use the crop tool in Acrobat Pro (9) and the page does resize, but the highlights and annotations go all over the place. I specifically need to scale the page content smaller (83%) but maintain page size and annotation/highlight to content connection and interactivity.

    An old trick (not recommended) would be to print to a new PDF with the page size selected but a scaling of the content. Only print the document, not the markup, to a new PDF. Close that PDF when done and reopen the old one (or maybe a copy of the old one for safety) and use Document Replace pages and select the new document to replace your current pages. You will then have to go back through the markup to locate it all correctly. There may be a more elegant way, but this may be the fastest.

Maybe you are looking for

  • Required standard report

    Hi, Please help me in getting the report. Require a report which should have  PO No., Material Code,  PO qunatity, GR quantity  and payment to supplier with respect to GR. Thanks...

  • PDF not restoring data once saved

    Hi guys, I've designed my form in Livecycle. I have then enabled "extend features in adobe reader" to allow my recipients the "Save as" option when they fill out the form. When I enter data, open it in Adobe Reader and fill it out, go to Save as and

  • Making AE faster and better in 3D

    In January 2014 Steve Forde asked a question in a blog post that said "What if we did NOTHING else in After Effects during 2014 other than make it faster? I mean MUCH faster." So my first question is: What happen to this and is this something that yo

  • IPhone 6 won't charge & Rotation Issues

    Hi Everyone (let me start by saying im sorry for spelling/grammatical errors you encounter I am angrily typing this) Brand new iPhone 6 probably 2 weeks old and it won't charge and when I can get it to charge battery drains to about 30% within maybe

  • How to turn of calling landlines?

    Please help me! I'm trying to call my cousins phone with skype, and i accidentally turned oninternational calling (I selected U.S since i figured it would reset it.) And tried calling them, but the pop up telling me to buy a sub or whatever wont stop