title: android image rotating, imports error
body: <p>Hi to all.</p>
  
  <p>I'm having a problem with the imports. It's showing me errors on the imports and if I remove them the <code>JpegImageMetadata</code>, <code>Sanselan</code>, <code>ImageReadException</code>, <code>TiffImageMetadata</code>, <code>ExifTagConstants</code> can't be resolved to a type.</p>
  
  <p>I'm using Android 2.3.3 and also tried Android 3.2, still had the same problem. Here are the imports:</p>
  
  <pre><code>import org.apache.sanselan.ImageReadException;
  import org.apache.sanselan.Sanselan;
  import org.apache.sanselan.formats.jpeg.JpegImageMetadata;
  import org.apache.sanselan.formats.tiff.TiffImageMetadata;
  import org.apache.sanselan.formats.tiff.constants.ExifTagConstants;
  </code></pre>
  
  <p>And this is the other part of the code that is showing the error (I can post the whole code if needed):</p>
  
  <pre><code>private int degreeRotated(String filePath) {
          try {
              JpegImageMetadata meta = ((JpegImageMetadata) Sanselan.getMetadata(new File(filePath)));
              TiffImageMetadata data = null;
              if (meta != null) {
                  data = meta.getExif();
              }
              int orientation = 0;
              if (data != null) {
                  orientation = data.findField(ExifTagConstants.EXIF_TAG_ORIENTATION).getIntValue();
              } else {
                  String[] projection = { Images.ImageColumns.ORIENTATION };
                  Cursor c = getContentResolver().query(Uri.fromFile(new File(filePath)), projection, null, null, null);
  
                  if (c != null &amp;&amp; c.moveToFirst()) {
                      orientation = c.getInt(0);
                  }
              }
              switch (orientation) {
                  case 6:
                      return 90;
                  case 8:
                      return 270;
                  default:
                      return 0;
  
              }
              /*
               * } catch (JpegProcessingException e1) { e1.printStackTrace(); }
               * catch (MetadataException e) { e.printStackTrace(); }
               */} catch (ImageReadException e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
          } catch (IOException e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
          }
  
          return 0;
      }
  </code></pre>
  
  <p>And this is the error log:</p>
  
  <pre><code>Description   Resource   Path   Location   Type
  ImageReadException cannot be resolved to a type   Viewer.java   /Main/src/com/owleyes/moustache   line 687   Java Problem
  ExifTagConstants cannot be resolved to a variable   Viewer.java   /Main/src/com/owleyes/moustache   line 666   Java Problem
  TiffImageMetadata cannot be resolved to a type   Viewer.java   /Main/src/com/owleyes/moustache   line 660   Java Problem
  Sanselan cannot be resolved   Viewer.java   /Main/src/com/owleyes/moustache   line 659   Java Problem
  JpegImageMetadata cannot be resolved to a type   Viewer.java   /Main/src/com/owleyes/moustache   line 659   Java Problem
  JpegImageMetadata cannot be resolved to a type   Viewer.java   /Main/src/com/owleyes/moustache   line 659   Java Problem
  The import org.apache.sanselan cannot be resolved   Viewer.java   /Main/src/com/owleyes/moustache   line 11   Java Problem
  The import org.apache.sanselan cannot be resolved   Viewer.java   /Main/src/com/owleyes/moustache   line 10   Java Problem
  The import org.apache.sanselan cannot be resolved   Viewer.java   /Main/src/com/owleyes/moustache   line 9   Java Problem
  The import org.apache.sanselan cannot be resolved   Viewer.java   /Main/src/com/owleyes/moustache   line 8   Java Problem
  The import org.apache.sanselan cannot be resolved   Viewer.java   /Main/src/com/owleyes/moustache   line 7   Java Problem
  </code></pre>