Changeset 36463 in osm


Ignore:
Timestamp:
2025-11-06T16:11:22+01:00 (7 weeks ago)
Author:
GerdP
Message:

fix #21523: Setting the direction of a panned 360 photo causes a counterintuitive result

  • apply photoadjust_21523_fix_direction_360.patch by gillux: "The arrow direction does not display the exif direction angle, instead it displays exif angle + image viewer angle. So when the plugin sets the exif angle from the arrow direction, it needs to substract the image viewer angle from it."
  • remove targets from build.xml which invoke perl or overwrite the code to build javadoc
Location:
applications/editors/josm/plugins/photoadjust
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/photoadjust/build.xml

    r36334 r36463  
    2626    <!-- ** include targets that all plugins have in common ** -->
    2727    <import file="../build-common.xml"/>
    28     <!-- ** internationalization ** -->
    29     <import file="i18n/build-i18n.xml"/>
    30 
    31     <target name="pot" description="Extract translatable strings from source." depends="gettext-init">
    32         <mkdir dir="${plugin.po.dir}"/>
    33         <gettext-extract keysFile="${ant.project.name}.pot" poDirectory="${plugin.po.dir}" keywords="-k -ktrc:1c,2 -kmarktrc:1c,2 -ktr -kmarktr -ktrn:1,2 -ktrnc:1c,2,3">
    34             <fileset dir="${plugin.src.dir}" includes="**/*.java"/>
    35         </gettext-extract>
    36         <echo file="${plugin.po.dir}/${ant.project.name}.pot" append="true">
    37 #. Plugin ${ant.project.name}
    38 #: build.xml:1
    39 msgid "${plugin.description}"
    40 msgstr ""
    41 </echo>
    42     </target>
    43 
    44     <!--
     28  <!--
    4529    **********************************************************
    46     ** javadoc - create the plugin documentation
     30    ** compile - complies the source tree
    4731    **********************************************************
    4832    -->
    49     <target name="javadoc" description="generate documentation">
    50         <javadoc destdir="${plugin.javadoc.dir}"
    51                 sourcepath="${plugin.src.dir}"
    52                 windowtitle="${ant.project.name}"
    53                 linksource="true"
    54                 private="true">
    55             <classpath>
    56                 <pathelement location="${josm}"/>
    57             </classpath>
    58             <!-- Paths are relative to javadoc destdir (${plugin.javadoc.dir}). -->
    59             <link href="../../../core/javadoc/"/>
    60             <link href="https://josm.openstreetmap.de/doc/"/>
    61             <link href="https://docs.oracle.com//javase/8/docs/api/"/>
    62         </javadoc>
    63     </target>
    64 
    65     <target name="additional-manifest">
    66         <antcall target="mftrans"/>
    67     </target>
     33 
    6834</project>
  • applications/editors/josm/plugins/photoadjust/src/org/openstreetmap/josm/plugins/photoadjust/PhotoAdjustWorker.java

    r36333 r36463  
    1616import org.openstreetmap.josm.gui.layer.geoimage.ImageEntry;
    1717import org.openstreetmap.josm.gui.layer.geoimage.ImageViewerDialog;
     18import org.openstreetmap.josm.gui.util.imagery.Vector3D;
     19import org.openstreetmap.josm.tools.Utils;
    1820
    1921/**
     
    240242        }
    241243        final LatLon mouseLL = MainApplication.getMap().mapView.getLatLon(evt.getX(), evt.getY());
     244        Vector3D viewerVector = ImageViewerDialog.getInstance().getRotation(photo);
     245        double viewerAngle = viewerVector != null ? Utils.toDegrees(viewerVector.getPolarAngle()) : 0d;
    242246        // The projection doesn't matter here.
    243         double direction = photoLL.bearing(mouseLL) * 360.0 / 2.0 / Math.PI;
     247        double direction = photoLL.bearing(mouseLL) * 360.0 / 2.0 / Math.PI - viewerAngle;
    244248        if (direction < 0.0) {
    245249            direction += 360.0;
Note: See TracChangeset for help on using the changeset viewer.