Changeset 32980 in osm
- Timestamp:
- 2016-09-11T13:48:08+02:00 (8 years ago)
- 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 55 55 this.ex.shutdown(); 56 56 JsonArray jsonArr = jsonObj.getJsonArray("ims"); 57 JsonObject data;58 57 for (int i = 0; i < jsonArr.size(); i++) { 59 data = jsonArr.getJsonObject(i);58 final JsonObject data = jsonArr.getJsonObject(i); 60 59 String key = data.getString("key"); 61 60 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 89 89 jsonobj.getString("key"), jsonobj.getJsonNumber("captured_at") 90 90 .longValue()); 91 List<MapillaryImage> finalImages = new ArrayList<>(images); 91 92 92 // Here it gets only those images which are in the downloaded 93 93 // area. 94 finalImages = images.parallelStream().filter(MapillarySequenceDownloadThread::isInside).collect(Collectors.toList());94 List<MapillaryImage> finalImages = images.parallelStream().filter(MapillarySequenceDownloadThread::isInside).collect(Collectors.toList()); 95 95 96 96 synchronized (MapillarySequenceDownloadThread.class) { -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/mode/AbstractMode.java
r32979 r32980 22 22 * @author nokutu 23 23 * @see MapillaryLayer 24 *25 24 */ 26 25 public abstract class AbstractMode extends MouseAdapter implements 27 26 ZoomChangeListener { 28 27 29 28 private static final int DOWNLOAD_COOLDOWN = 2000; … … 46 45 double dist = clickPoint.distanceSq(imagePoint); 47 46 if (minDistance > dist && clickPoint.distance(imagePoint) < snapDistance 48 47 && image.isVisible()) { 49 48 minDistance = dist; 50 49 closest = image; … … 58 57 * 59 58 * @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. 62 60 * @param box Area where painting is going to be performed 63 61 */ … … 92 90 while (true) { 93 91 if (this.moved 94 92 && Calendar.getInstance().getTimeInMillis() - this.lastDownload >= DOWNLOAD_COOLDOWN) { 95 93 this.lastDownload = Calendar.getInstance().getTimeInMillis(); 96 94 MapillaryDownloader.completeView(); … … 98 96 MapillaryData.dataUpdated(); 99 97 } 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; 106 102 } 107 103 } -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/oauth/UploadUtils.java
r32979 r32980 145 145 * @throws ImageWriteException if there are errors writing the image in the file. 146 146 */ 147 privatestatic File updateFile(MapillaryImportedImage image)147 static File updateFile(MapillaryImportedImage image) 148 148 throws ImageReadException, IOException, ImageWriteException { 149 149 TiffOutputSet outputSet = null; … … 153 153 154 154 // 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 } 157 162 158 163 if (null != jpegMetadata) {
Note:
See TracChangeset
for help on using the changeset viewer.