Rotating JPEG images with feh [SOLVED]

A funny thing happened to me using feh today.
It seems it can't rotate JPEG images 90 degrees (neither clockwise, nor counterclockwise). Whenever I try (with different files), feh dies with the following error message:
Bogus virtual array access
It can do it if it's 180 degrees. It can also rotate PNG images 90 and 180 degrees without any problem.
Did someone else experience this? Is the new libjpeg to blame? Should I open a bug report?
Last edited by megadriver (2010-03-05 06:56:25)

I'm not sure feh is actively developed/maintained any more, but you could email the author* - I'm sure he'd fix something like this. If indeed it is a bug (of course). Can't check myself, yet - will do later.
Meantime check imagemagick (and the convert command), if you need an alternative.
* though I'd be happy if I was wrong.

Similar Messages

  • How to set color space to JPEG image with Java advance Imaging

    How to set color space to JPEG image with Java advance Imaging.
    is there any API in JAI which support to set color space.

    I'm definately no guru, but this is how you can change it.
    CTRL + ALT + Click on the part of the component that you want to change. This brings up the Hidden Dom Inspector, background of component will be surrounded with a red outline (Make sure the red outline is surrounding the part of the tabset you want to change), Now you go to properties sheet and click the ellipses next to rules property this will pop up a dialog you look in this list (At the top) to see the default style classes that are affecting the rendering of the component outlined in red. (You will be able to select different sections of a single component) then you just rewrite the style class that you want to change in your Stylesheet (You will not find the styleclass that you want to change because it is a part of your theme .jar but as long as you name it exactly the same and place in your stylesheet it will override the theme .jar style classes) it's actually very easy -- you were right should be a piece of cake for a guru. Don't have the link handy but you can check out Winston's Blog on changing Table Formatting to get this information...It is EXTREMELY useful if you want your apps to have a custom look and not default that comes with Creator Themes.
    Hope this helps you out God knows others have helped me alot!
    Jason

  • JPEG image with interlacing / progression

    Why is bug 4675817
    http://developer.java.sun.com/developer/bugParade/bugs/4675817.html
    closed?
    I'm using J2SDK1.4.2 and with JWS my application just quits when trying to display a JPEG image with interlacing / progression.

    This is an infuriating bug; I couldn't believe how much time I wasted before I found the bugreports � by which time I was ready to hang, draw & quarter the guilty party (or the nearest sun employee).
    The bug seemed closed against a similar bugreport, and this in turn has been closed against Tiger � which is 1.5 the next upcoming major release; which will probably happen next year now.
    - Richard

  • Manipulating (Rotating) an Image with a button in Java

    I'm trying to display an image in a BorderLayout, and also I want a button on the layout that, when pressed, will rotate the image. I'm not sure how to create an image and be able to add it to a JFrame because when I do so, using something like:
    Image img = new Image("myPic.gif");
    myFrame.add(img, BorderLayout.CENTER);
    I just end up getting a compiler error. I could use a seperate class and draw the image in the paintComponent method, but I'm not sure how I add both the image and a button with which I can manipulate the image in the same class (I am assuming I need to use an ActionListener on the button to control the image, and if this is the case I am assuming they need to be in the same class). Can someone point me in the right direction here?
    Thanks,
    Alex
    [email protected]

    put the image in a JPanel subclass as you mention above and have a public method in this class that rotates the image. Then just have the button call this object's rotate method. OOP to the rescue.

  • How to show JPEG-images with Forms?

    I am able to display .bmp-images in Forms, but according to the documentation it must be possible to display JPEG-images as well. How do I do that?
    null

    Procedure is the same as you call bmp. but you have to write 'JPEG' in place of format where you write bmp. and file_name.JPG where you write file_name.bmp.
    That may help.
    Mustafa

  • Rendering A JPEG image with a custom tag

    Hi All,
    I have dilema. I'm trying to rendering a jpeg in IE/FireFox with a custom tag that I developed. I'm able to access the bean and invoke the getter method to return the InputStream property. But what gets rendered is the byte code not the image. I've tried just about anything I could think off. If any body has an answer I would difinitely appreciate it.
    Thanks,
    Tony
    Below is the jsp, tld, bean and tag.
    ********************************* image.jsp ****************************************
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <%@ taglib uri="/WEB-INF/custom-chtml.tld" prefix="chtml" %>
    <html>
    <head>
    <title>HTML Page</title>
    </head>
    <body bgcolor="#FFFFFF">
    <chtml:img name="photo" property="file"/>
    </body>
    </html>
    ********************************* custom-chtml.tld **********************************
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE taglib PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN" "http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd">
    <taglib>
    <tlibversion>1.0</tlibversion>
    <jspversion>1.1</jspversion>
    <shortname>chtml</shortname>
    <tag>
    <name>img</name>
    <tagclass>com.struts.taglib.CustomImgTag</tagclass>
    <bodycontent>empty</bodycontent>
    <attribute>
    <name>name</name>
    <required>false</required>
    <rtexprvalue>true</rtexprvalue>
    </attribute>
    <attribute>
    <name>property</name>
    <required>true</required>
    <rtexprvalue>true</rtexprvalue>
    </attribute>
    </tag>
    </taglib>
    **************************** MemberPhotoBean.java ******************************
    import java.io.InputStream;
    * @author tony
    * TODO To change the template for this generated type comment go to
    * Window - Preferences - Java - Code Style - Code Templates
    public class MemberPhotoValue {
         private String memberId;
         private int fileSize;
         private InputStream file;
         public MemberPhotoValue() {
         public MemberPhotoValue(String memberId, InputStream file) {
              this.memberId = memberId;
              this.file = file;
         public MemberPhotoValue(String memberId,int fileSize,InputStream file) {
              this.memberId = memberId;
              this.fileSize = fileSize;
              this.file = file;          
         public String getMemberId(){
              return memberId;
         public void setMemberId(String memberId) {
              this.memberId = memberId;
         public int getFileSize() {
              return fileSize;
         public void setFileSize(int fileSize) {
              this.fileSize = fileSize;
         public InputStream getFile(){
              return file;
         public void setFile(InputStream file) {
              this.file = file;
    *************************** CustomTagHandler.java ********************************
    import java.io.*;
    import javax.imageio.ImageIO;
    import javax.servlet.*;
    import javax.servlet.jsp.*;
    import javax.servlet.jsp.tagext.*;
    import java.lang.reflect.Method;
    import java.lang.reflect.InvocationTargetException;
    import java.awt.image.*;
    import java.awt.*;
    import javax.swing.ImageIcon;
    import com.sun.image.codec.jpeg.*;
    * JSP Tag Handler class
    * @jsp.tag name = "CustomImg"
    * display-name = "Name for CustomImg"
    * description = "Description for CustomImg"
    * body-content = "empty"
    public class CustomImgTag implements Tag {
         private PageContext pageContext;
         private Tag parent;
         private String property;
         private String name;
         private Class bean;
         public int doStartTag() throws JspException {
              return SKIP_BODY;
         public int doEndTag() throws JspException {
         try {
         ServletResponse response = pageContext.getResponse();
         // read in the image from the bean
         InputStream stream = (InputStream) invokeBeanMethod();
         BufferedImage image = ImageIO.read(stream);          Image inImage = new ImageIcon(image).getImage();
         Graphics2D g = image.createGraphics();
         g.drawImage(inImage,null,null);               
         OutputStream out = response.getOutputStream();
    // JPEG-encode the image
    JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(out);
    encoder.encode(image);               
         out.close();     
    } catch (IOException io) {
              throw new JspException(io.getMessage());
         return EVAL_PAGE;
         public void release(){}
    private InputStream invokeBeanMethod() throws JspException {
         try {
         Object bean = null;
         if (null != pageContext.getAttribute(name)) {
         bean = (Object) pageContext.getAttributename);
         else if (null != pageContext.getSession().getAttribute(name)) {
         bean = (Object) pageContext.getSession().getAttribute(name);
         else if (null != pageContext.getRequest().getAttribute(name)) {
         bean = (Object) pageContext.getRequest().getAttribute(name);
         else {
         throw new JspException("Bean : "+name+" is not found in any pe.");
         Class[] parameters = null;
         Object[] obj = null;               
         Method method = bean.getClass().getMethod("getFile",parameters);
         return (InputStream) method.invoke(bean,obj);
         } catch (NoSuchMethodException ne) {
         throw new JspException("No getter method "+property+" for bean : "+bean);
         } catch (IllegalAccessException ie) {
         throw new JspException(ie.getMessage());
         } catch (InvocationTargetException ie) {
         throw new JspException(ie.toString());
         public void setPageContext(PageContext pageContext) {
              this.pageContext = pageContext;
         public void setParent(Tag parent) {
              this.parent = parent;
         public Tag getParent() {
              return parent;
         public void setProperty(String property) {
              this.property = property;
         public void setName(String name) {
              this.name = name;
    **************************************************************************************

    If you have access to an image editing tool such as photoshop, I would advice you import the image into Phototshop and save it in a different format e.g, GIF format and re-import it into Final Cut Express HD. This could solve your rendering problem if all you need is to use a Still image.
    Ayemenre

  • Can't see jpeg images with RAW

    Hi All,
    I'm using a Canon 5d11 with setting for RAW + jpeg combo. When I import to Aperture, all I can se is the RAW CR2 image. I tried a search etc. but no luck. Am I missing something or setting to view both or are they someplace else in separate folders?
    Thanks for any help.
    John

    Under Images menu there is a "Create Version from Master JPG". They are combined in one thumbnail but if you use the menu item on all the selected thumbnails you will get the JPG.

  • How to store jpeg images with IMAQ PCI-1409 without vision or labview

    I have acquired an IMAQ PCI-1409 card and have it working just fine. However the card is being primarily used to aquire images for display purposes only. The only options with MAX are .tiff, .bmp and .png
    It would be nice to be able to store images as .jpeg which would be easier to share with other people.
    Is this possible or do I have to compress the images using another software?

    Hello,
    Thank you for contacting National Instruments.
    Unfortunately, as you mentioned, the only save options available in MAX are TIFF, BMP, and PNG. In order to save the image as a JPEG, you will need to use another software program. Microsoft Paint will allow you to save/convert any of these types to JPEG format. Other programs (Adobe Photoshop for example) allow you to customize the compression used, but Microsoft Paint does not.
    Best Regards,
    Jesse D.
    Applications Engineer
    National Instruments

  • Preview has difficulties with rotating EXIF rotated JPEGs

    Ave!
    I've been searching a lot here about this problem, but didn't found anything, so I decided to post here my bugreport.
    If you are watching EXIF rotated JPEG images with Preview (e.g. your digital camera automatically rotates them) everything is OK, they are displayed in the correct orientation. But if you want to rotate them - well, then they don't act as the should.
    Here is a sample video:
    http://lka.hu/other/x/preview-rotate-bug.mov
    Here are this pictures:
    http://www.freeweb.hu/gk-lka/index.php?dir=GALLERY/Vegyes/Rotate_test
    Their name reflects the angle which they have been rotated with.
    Please (please!) correct this issue in the upcoming 10.5.3 release of OS X Leopard!

    To start with, this isn't where you let Apple know about bugs. The proper place is the Bug Reporter, you access it by joining Apple Developer Connection. You can do it out here:
    http://developer.apple.com/bugreporter/
    There was a bug report on the Tiger version of Preview which I filed last year, it was a bit convoluted, but also involved rotation. I received a notice when they fixed it, with the release of Leopard. Here's the thread where the problem was discussed:
    http://discussions.apple.com/thread.jspa?threadID=1111412
    I just checked with a photo from my Canon digital camera, that had the orientation tag set to portait. As expected, opening with Preview displayed it in portrait view. I then rotated 90 and saved. It opened back up in Preview in landscape. Safari (which doesn't read rotation metadata) also displayed it in landscape, as did PS Elements, meaning that the rotation was applied to actual pixels, rather than just changing the metadata orientation tag. I then rotated it to 180, so it was in portrait, but upside down, and saved. It displayed upside down in Preview, Safari and Elements. Is this what you mean about a "bug"? Namely, that the rotation is actually being applied to the pixels, rather than just changing the metadata tag? If so, I'm not sure that it is a bug, or if that's the way Preview works now.
    Francine
    Francine
    Schwieder

  • Rotating Image with Fade Effect

    Ok looking to rotate an image with a fade effect; below is a rotating image code.
    (Wanting this effect to be transitional and smooth. Transparency? Opacity?)
    <script language="JavaScript">
    <!--
    function adArray() {
    for (i=0; i*2<adArray.arguments.length; i++) {
    this[i] = new Object();
    this[i].src = adArray.arguments[i*2];
    this[i].href = adArray.arguments[i*2+1];
    this.length = i;
    function getAdNum() {
    dat = new Date();
    dat = (dat.getTime()+"").charAt(8);
    if (dat.length == 1)
    ad_num = dat%ads.length;
    else
    ad_num = 0;
    return ad_num;
    var ads = new adArray(
    "img1.jpg","http://www.domain.com",
    "img2.jpg","http://www.domain.com",
    "img3.jpg","http://www.domain.com");
    var ad_num = getAdNum();
    document.write('<div align="center"><A HREF="'+ads[ad_num].href+'" target="_blank"><IMG SRC="'+ads[ad_num].src+'" '
    +'BORDER=0 name=js_ad></A></div>');
    link_num = document.links.length-1;
    function rotateSponsor() {
    if (document.images) {
    ad_num = (ad_num+1)%ads.length;
    document.js_ad.src = ads[ad_num].src;
    document.links[link_num].href = ads[ad_num].href;
    setTimeout("rotateSponsor()",4000);
    setTimeout("rotateSponsor()",4000);
    // -->
    </script>
    Any ideas?

    Here is the script I finally got working! It would have not came to me without your help guys!
    <script>
    var pictureWebPartName="Pictures"; // name of the picture library web part
    var showThumbnails = true; //otherwise show full sized images
    var randomImg = true; //set to true to show in random order
    var useCustomLinks = false; //true to use second column as URL for picture clicks
    var RotatingPicturesLoopTime = 5000; //2000 = 2 seconds
    var imgToImgTransition = 1.0; //2 = 2 seconds
    // don't change these
    var selectedImg = 0;
    var imgCache = [];
    var imgTag;
    function RotatingPictures()
    imgTag = document.getElementById("RotatingImage");
    //Find the picture web part and hide it
    var Imgs = [];
    var x = document.getElementsByTagName("TD"); // find all of the table cells
    var LinkList;
    var i=0;
    for (i=0;i<x.length;i++)
    if (x[i].title == pictureWebPartName)
    // tables in tables in tables... ah SharePoint!
    LinkList = x[i].parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode;
    // hide the links list web part
    LinkList.style.display="none";
    break;
    if (!LinkList)
    document.all("RotatingImageMsg").innerHTML="Web Part '" + pictureWebPartName + "' not found!";
    //Copy all of the links from the web part to our array
    var links = LinkList.getElementsByTagName("TR") // find all of the rows
    var url;
    var len;
    for (i=0;i<links.length;i++)
    //if (links(i).id.match("row")!=null)
    if (links[i].childNodes[0].className=="ms-vb2")
    len=Imgs.length
    Imgs[len]=[]
    Imgs[len][0] = links[i].childNodes[0].childNodes[0].href;
    if (useCustomLinks)
    if (links[i].childNodes[1].childNodes.length>0)
    { Imgs[len][1] = links[i].childNodes[1].childNodes[0].href; }
    else
    { Imgs[len][1] = "" }
    if (Imgs.length==0)
    document.all("RotatingImageMsg").innerHTML="No images found in web part '" + pictureWebPartName + "'!";
    for (i = 0; i < Imgs.length; i++)
    imgCache[i] = new Image();
    imgCache[i].src = Imgs[i][0];
    if (useCustomLinks)
    imgCache[i].customlink=Imgs[i][1];
    RotatingPicturesLoop();
    // now show the pictures...
    function RotatingPicturesLoop()
    if (randomImg)
    selectedImg=Math.floor(Math.random()*imgCache.length);
    if (document.all){
    imgTag.style.filter="blendTrans(duration=" + imgToImgTransition + ")";
    imgTag.filters.blendTrans.Apply();
    url=imgCache[selectedImg].src
    if (useCustomLinks)
    { RotatingImageLnk.href=imgCache[selectedImg].customlink; }
    else
    { RotatingImageLnk.href = url; }
    if (showThumbnails)
    // convert URLs to point to the thumbnails...
    // from airshow%20pictures/helicopter.jpg
    // to airshow%20pictures/_t/helicopter_jpg.jpg
    url = revString(url);
    c = url.indexOf(".");
    url = url.substring(0,c) + "_" + url.substring(c+1,url.length);
    c = url.indexOf("/");
    url = url.substring(0,c) + "/t_" + url.substring(c,url.length);
    url = revString(url) + ".jpg";
    imgTag.src = url;
    if (document.all){
    imgTag.filters.blendTrans.Play();
    selectedImg += 1;
    if (selectedImg > (imgCache.length-1)) selectedImg=0;
    setTimeout(RotatingPicturesLoop, RotatingPicturesLoopTime);
    // utility function revString found here:
    // http://www.java2s.com/Code/JavaScript/Language-Basics/PlayingwithStrings.htm
    function revString(str) {
    var retStr = "";
    for (i=str.length - 1 ; i > - 1 ; i--){
    retStr += str.substr(i,1);
    return retStr;
    // add our function to the SharePoint OnLoad event
    _spBodyOnLoadFunctionNames.push("RotatingPictures");
    </script>
    <!-- add your own formatting here... -->
    <center>
    <table border="0" cellpadding="0" cellspacing="0">
    <tr>
    <td id="VU" height="125" width="160" align="center" valign="middle">
    <a name="RotatingImageLnk" id="RotatingImageLnk" alt="click for larger picture">
    <img src="/_layouts/images/dot.gif" name="RotatingImage" id="RotatingImage" border=0>
    </a>
    <span name="RotatingImageMsg" id="RotatingImageMsg"></span>
    </td>
    </tr>
    </table>
    </center>
    Thanks again guys!

  • How to get a jpeg image to a movie with best possible quality

    I've got a jpeg image from my 2 megapixel digital camera and I'm playing around with converting it to a movie. Yes, its a one image movie.
    +QuickTime Pro+ does a superb job when I choose H.264, 1024 kb/s, but I can't get iMovie 5.0.2 to give me the same quality. This is what I have done:
    1. Create a new movie as type MPEG-4.
    2. Imported the jpeg image and adjust the time from 5 seconds to about 2 seconds.
    3. Select Share, choose H.264, 1024 kb/s from the relevant option and after the movie making happens, the quality is obviously inferior to that from +QT Pro+.
    *QUES 1*: Why is the quality inferior?
    I have been to iMovie help and noticed this comment:
    "When you import clips in a format different from your project, they are converted to the video format of your movie."
    *QUES 2*: Is this why my jpeg image is losing quality? Is iMovie converting it to something else?
    Further, when the jpeg image is first imported, it is assigned a clip time of 5 seconds. When I move one of the sliders to reduce the time to just a few seconds, I notice that a black band appears at the top of the image in the iMovie window and as I make the time smaller, the image zooms in and the black band becomes wider. Letterboxing at the top seems to be occuring. This I can't fathom.
    *QUES 3*: Why does iMovie zoom in when I adjust time?
    Any comments most appreciated, especially those that tell me if iMovie can make a movie from jpeg images with the same quality as QT Pro -- and how to do that.

    Re the quality -- I think I have answered this one myself. Correct me if I'm wrong, but it seems to me that when I select a video option (DV, HD 1080 and so on), iMovie sets up a frame size to suit, and the frame size that iMovie sets up for MPEG-4 happens to be 640 x 480, thus the poor quality of my jpegs when I selected that option. The poor quality had nothing to do with the MPEG-4 format.
    Now the interesting things is, MPEG-4 is not limited to 640 x 480. It can be any size. So my question is:
    Ques: Can I set up a movie within iMovie that is any size I want? QT Pro gave better results because it allows any size movie at all, and thus adjusted the movie size to my jpeg size (1800 x 1200 pixels) when I imported an image from my digital camera.
    As it stands, not even the highest quality option in +iMovie 5.0.2+ (HD 1080) can handle the images from my piddly-little 2 megapixel camera.
    Message was edited by: Guy Burns

  • Rotate an image after clicking two times on reference points on the picture

    Hello Community!
    I am looking for a solution to rotate an image by clicking on two reference points on the image. The two coordinate pairs of the mouse clicking can give me the rotation angle with simple geometry. After that I will rotate the image with the calculated angle.
    My problem is: How can I get those two coordinate pairs? I wanted to do it with an easy MatlabScript "input: path ... imread(path) ... imshow ... ginput(2) ... calculation ...output: angle". Apparently imshow doesnt work in Labview
    I already have the Mouse Down event but I dont know how I can make Labview let me click EXACTLY and ONLY two times on my picture and store the coordinates.
    Does anyone of you have a glue/ hint how to do that? 
    Best,
    Annki
    (Started LabView 2 weeks ago)
    Solved!
    Go to Solution.

    Hi Annkitranky,
    welcome to the forum!
    Here is one that works well: http://en.wikipedia.org/wiki/Cyanoacrylate  (Sorry, I couldn't resist...)
    Check this out: http://forums.ni.com/t5/LabVIEW/Using-mouse-click-to-return-image-coordinates/m-p/890731 and http://forums.ni.com/t5/LabVIEW/How-to-find-cursor-position-on-an-image-in-LabVIEW/m-p/1862495 There is a suggestion not marked as a solution, but I think it is: see last posts there; User Event Structure with the position reported implicitly. Further, I would put the Event Structure in the While Loop, where I wait for user input, collect the user inputs and finish (execute rotation on a two-element array).
    If you have a code or something, post it.
    Cheers

  • Unable to open saved edited jpeg image

    Not being the most techie type person, sorry if this is repeated in numerous place on the forum. I can see, and open, the images in thumbnail form in my 'Picture - Library'. I can then edit them in PE 10, but when I 'save as' (and I save as jpeg image with a version of IMG_****.jpeg copy ) the 'copy' jpeg thumbnail appears in the library as a blank page and no image. I'm then unable to open the 'saved' copy as it's the 'wrong type'. I've tried numerous images but to no avail. Any advice will be greatly appreciated.

    Change IMG_****.jpeg copy to IMG_****copy.jpeg

  • Unable to open saved JPEG images

    I opened and modified several JPEG images with Photoshop CS2. Now none of these files can be opened by Photoshop or any other program. All of the files seem to have a non-zero size, but when I try to open them in Photoshop, it does not generate an error, it merely offers to create a new file with the same image properties (size, etc) as the saved image on disk.
    I've also tried several other programs to open these files, and none of them can open them. FYI, one thing that all of the files have in common is that they are all saved with the absolute minimum compression settings.
    Any assistance in helping me to recover these files would be greatly appreciated.
    Thanks.

    You can email me one of the Pics (zip it first) but it sounds like they are toast.

  • ID ePUB export converts all *inline* anchored JPEG images to PNG?

    During ePUB export, when Image Conversion = Automatic, anchored JPEG images with Position = Inline are converted to PNG. If Anchored Object Position = Custom, the same images stay JPEG. Anyone know a better way to avoid than the less-than-ideal options below?
    Less than idea options:
    a) Use Image Conversion = JPEG (would also convert existing .gif and .png images)
    b) Specify Object Export Options for each image frame that contains a JPEG.
    Maybe this is just a bug.

    Here's the definition from the InDesign Help file:
    Image Conversion
    Lets you choose whether the optimized images in your document are converted to GIF, JPEG, or PNG. Choose Automatic to let InDesign decide which format to use in each instance. Choosing PNG disables the image compression settings; use PNG for lossless images or for images that include transparency.
    Choosing Automatic means InDesign decides which format to use. It doesn't mean keep the same format.

Maybe you are looking for