Changeset 32980 in osm for applications/editors


Ignore:
Timestamp:
2016-09-11T13:48:08+02:00 (8 years ago)
Author:
nokutu
Message:

More warning fixed and a building error

Location:
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/io/download/MapillaryImageInfoDownloadThread.java

    r32979 r32980  
    5555          this.ex.shutdown();
    5656        JsonArray jsonArr = jsonObj.getJsonArray("ims");
    57         JsonObject data;
    5857        for (int i = 0; i < jsonArr.size(); i++) {
    59           data = jsonArr.getJsonObject(i);
     58          final JsonObject data = jsonArr.getJsonObject(i);
    6059          String key = data.getString("key");
    6160          MapillaryLayer.getInstance().getData().getImages().stream().filter(image -> image instanceof MapillaryImage
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/io/download/MapillarySequenceDownloadThread.java

    r32979 r32980  
    8989          jsonobj.getString("key"), jsonobj.getJsonNumber("captured_at")
    9090          .longValue());
    91         List<MapillaryImage> finalImages = new ArrayList<>(images);
     91
    9292        // Here it gets only those images which are in the downloaded
    9393        // area.
    94         finalImages = images.parallelStream().filter(MapillarySequenceDownloadThread::isInside).collect(Collectors.toList());
     94        List<MapillaryImage> finalImages = images.parallelStream().filter(MapillarySequenceDownloadThread::isInside).collect(Collectors.toList());
    9595
    9696        synchronized (MapillarySequenceDownloadThread.class) {
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/mode/AbstractMode.java

    r32979 r32980  
    2222 * @author nokutu
    2323 * @see MapillaryLayer
    24  *
    2524 */
    2625public abstract class AbstractMode extends MouseAdapter implements
    27     ZoomChangeListener {
     26  ZoomChangeListener {
    2827
    2928  private static final int DOWNLOAD_COOLDOWN = 2000;
     
    4645      double dist = clickPoint.distanceSq(imagePoint);
    4746      if (minDistance > dist && clickPoint.distance(imagePoint) < snapDistance
    48           && image.isVisible()) {
     47        && image.isVisible()) {
    4948        minDistance = dist;
    5049        closest = image;
     
    5857   *
    5958   * @param g {@link Graphics2D} used for painting
    60    * @param mv
    61    *          The object that can translate GeoPoints to screen coordinates.
     59   * @param mv The object that can translate GeoPoints to screen coordinates.
    6260   * @param box Area where painting is going to be performed
    6361   */
     
    9290      while (true) {
    9391        if (this.moved
    94             && Calendar.getInstance().getTimeInMillis() - this.lastDownload >= DOWNLOAD_COOLDOWN) {
     92          && Calendar.getInstance().getTimeInMillis() - this.lastDownload >= DOWNLOAD_COOLDOWN) {
    9593          this.lastDownload = Calendar.getInstance().getTimeInMillis();
    9694          MapillaryDownloader.completeView();
     
    9896          MapillaryData.dataUpdated();
    9997        }
    100         synchronized (this) {
    101           try {
    102             Thread.sleep(100);
    103           } catch (InterruptedException e) {
    104             return;
    105           }
     98        try {
     99          Thread.sleep(100);
     100        } catch (InterruptedException e) {
     101          return;
    106102        }
    107103      }
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/oauth/UploadUtils.java

    r32979 r32980  
    145145   * @throws ImageWriteException if there are errors writing the image in the file.
    146146   */
    147   private static File updateFile(MapillaryImportedImage image)
     147  static File updateFile(MapillaryImportedImage image)
    148148          throws ImageReadException, IOException, ImageWriteException {
    149149    TiffOutputSet outputSet = null;
     
    153153
    154154    // If the image is imported, loads the rest of the EXIF data.
    155     ImageMetadata metadata = Imaging.getMetadata(image.getFile());
    156     JpegImageMetadata jpegMetadata = (JpegImageMetadata) metadata;
     155    JpegImageMetadata jpegMetadata = null;
     156    try {
     157      ImageMetadata metadata = Imaging.getMetadata(image.getFile());
     158      jpegMetadata = (JpegImageMetadata) metadata;
     159    } catch (Exception e) {
     160      Main.warn(e);
     161    }
    157162
    158163    if (null != jpegMetadata) {
Note: See TracChangeset for help on using the changeset viewer.