Opened 4 years ago
Closed 4 years ago
#20310 closed enhancement (fixed)
[Patch] ImageImporter should understand web URL's
Reported by: | taylor.smock | Owned by: | team |
---|---|---|---|
Priority: | normal | Milestone: | 21.02 |
Component: | Core remotecontrol | Version: | |
Keywords: | Cc: |
Description
Use cases:
- Image files stored on the web (this will only allow single files to be added at a time)
For example, at this time, StreetComplete creates links in notes to pictures. (To download planet notes, see https://planet.openstreetmap.org/notes/ ).
This can be used to fairly quickly resolve a note in MapRoulette via remote control.
I.e., a parsing program could take the note db, and for every note that has a url that looks like https?://.*\.jpg
, create a remote control URL that looks like http://127.0.0.1:8111/open_file?filename=<url>
.
Attachments (4)
Change History (23)
by , 4 years ago
Attachment: | 20310.patch added |
---|
comment:1 by , 4 years ago
Summary: | JpgImporter should understand web URL's → [Patch] JpgImporter should understand web URL's |
---|
Is this worth an own settings option to en-/disable the feature?
comment:2 by , 4 years ago
I didn't think about that, but some people would probably appreciate that.
Locations:
- Advanced Preferences (no UI element, good initial first step)
- Remote Control (this is probably the best place for the UI element, since a user would otherwise expect it to "just work")
- If this is the case, then passing Strings around might be better than passing a File around, or having some method to get a "real" pathname (
new File(String)
replaces//
with/
).
- If this is the case, then passing Strings around might be better than passing a File around, or having some method to get a "real" pathname (
- Some other location
comment:3 by , 4 years ago
As you need to enable remote control in preferences, I think it could go with all the other options there and its default should be enabled like all other options.
comment:4 by , 4 years ago
Notes on attachment:20310.1.patch:
- Replace boolean option with enum option (specifically,
recordHistory
) - Mark several methods as deprecated (docs have
@deprecated .*[Ss]ince xxx.*
-- hopefully, the@since xxx
replacement script also replaces those) - When storing enums, use
EnumSet
instead of an Array. Most methods take an array instead of a set.
comment:8 by , 4 years ago
Milestone: | → 21.02 |
---|
follow-up: 15 comment:10 by , 4 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
@Taylor the newly deprecated API is still being used in JOSM core, can you please provide a patch?
compile: [javac] Compiling 1640 source files to /tmp/josm/josm/build [javac] /tmp/josm/josm/src/org/openstreetmap/josm/gui/MainApplication.java:1278: warning: [deprecation] openFiles(List<File>,boolean) in OpenFileAction has been deprecated [javac] tasks.add(OpenFileAction.openFiles(fileList, true)); [javac] ^ [javac] /tmp/josm/josm/src/org/openstreetmap/josm/gui/io/RecentlyOpenedFilesMenu.java:87: warning: [deprecation] setRecordHistory(boolean) in OpenFileTask has been deprecated [javac] task.setRecordHistory(true); [javac] ^ [javac] /tmp/josm/josm/src/org/openstreetmap/josm/gui/datatransfer/importers/FilePaster.java:36: warning: [deprecation] setRecordHistory(boolean) in OpenFileTask has been deprecated [javac] task.setRecordHistory(true); [javac] ^ [javac] 3 warnings
follow-up: 12 comment:11 by , 4 years ago
Vincent, is it possible that my patch in #20341 / [17548] conflicted with this patch?
Because the patch from the other ticket was uploaded before this one was committed, and it seems the newly created ImageImporter does not reflect the changes that were made to JpgImporter in this ticket anymore.
comment:12 by , 4 years ago
follow-up: 14 comment:13 by , 4 years ago
Summary: | [Patch] JpgImporter should understand web URL's → [Patch] ImageImporter should understand web URL's |
---|
I merged the changes to ImageImporter
, but didn't test anything.
@Taylor could you please confirm if it works as intended?
by , 4 years ago
Attachment: | 20310.2.diff added |
---|
comment:14 by , 4 years ago
Replying to Bjoeni:
I merged the changes to
ImageImporter
, but didn't test anything.
@Taylor could you please confirm if it works as intended?
It does work as intended.
curl -O 'http://127.0.0.1:8111/open_file?filename=https://mongoose-d3mo.s3-us-west-2.amazonaws.com/Mexico/Guadalajara/ipad_3/day_2/front/BlackVue/Record/20200612_201036_NF/20200612_201036_NF_000111.jpg'
is what I used to test (note: that URL might stop working at some point in time).
by , 4 years ago
Attachment: | 20310.deprecated_update.patch added |
---|
Update deprecated methods used elsewhere in JOSM core
comment:15 by , 4 years ago
Replying to Don-vip:
@Taylor the newly deprecated API is still being used in JOSM core, can you please provide a patch?
Done. I should have done this earlier.
comment:17 by , 4 years ago
@Vincent attachment:20310.2.diff is not applied yet - not sure if you have seen it :)
Allow JpgImporter to import remote images