Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added valves quest #644

Merged
merged 12 commits into from
Sep 12, 2024
Merged

Added valves quest #644

merged 12 commits into from
Sep 12, 2024

Conversation

mcliquid
Copy link

@mcliquid mcliquid commented Sep 8, 2024

Fixes streetcomplete#4450

TODO:

  • Add custom icon (can't find a "valve" on SVG repo)
  • Enable multi selection of values

@mcliquid

This comment was marked as outdated.

@mcliquid mcliquid marked this pull request as ready for review September 9, 2024 08:20
@mcliquid
Copy link
Author

mcliquid commented Sep 9, 2024

From my point of view, the Quest is ready for review. I have tested it myself and it works well.
I am now looking for a better / own Quest icon. If I can't find a good one, I would go with the air pump icon.

@mcliquid
Copy link
Author

mcliquid commented Sep 9, 2024

Almost forgotten: The three pictures with the dark blue background are copyrighted. The author from Austria consents to their use with reference to the license, his name and his website. Is this sufficient via the authors.txt? Or should the name be written on the image? Or should I write to the author personally and ask?

@mcliquid
Copy link
Author

mcliquid commented Sep 9, 2024

I tried to make my own icon with a valve. What do you think?
P.S.: It looks like a spark plug.

valve

@mcliquid
Copy link
Author

mcliquid commented Sep 9, 2024

I would say it's okay once you know what it is because you activated the quest in the quest settings anyway.
Screenshot_20240909-103658.png

@mnalis

This comment was marked as resolved.

@mcliquid
Copy link
Author

mcliquid commented Sep 9, 2024

@mnalis Thanks for the hint to search Wikimedia Commons! I immediately went to the pictures on the wiki without considering whether there were any alternatives. So great that Bohwaz photographed all four valves with the same technique and made them available under copyleft! PR has been updated.

@mcliquid
Copy link
Author

mcliquid commented Sep 9, 2024

New screenshot with the new icon and the new pictures:
Screenshot_20240909-164705.png

@HolgerJeromin
Copy link

https://www.schwalbe.com/clik-valve-ventil/
Will be released in a few weeks/month :-)

Co-authored-by: Holger Jeromin <mailgithub@katur.de>
@mcliquid
Copy link
Author

mcliquid commented Sep 9, 2024

https://www.schwalbe.com/clik-valve-ventil/
Will be released in a few weeks/month :-)

  1. the SCVs will be backwards compatible with normal SV valves anyway.
  2. the new valves were announced months ago, but are still not available and therefore not yet available "on the ground".
  3. do you have a suitable picture for the quest? :)

app/src/main/res/authors.txt Outdated Show resolved Hide resolved
@mcliquid
Copy link
Author

@HolgerJeromin (Off-Topic): I created the wiki page for valves. I could also include the new Schwalbe Clik valve, but I wanted to make sure that you would also have captured it with valves=clik? So far there is no usage and as soon as it is added to the wiki, we will give a direction. The official name is “Schwalbe Clik Valve” with the abbreviation “SCV”. Would schwalbe_clik_valve then be more correct?

@HolgerJeromin
Copy link

@mcliquid Good question.
The other values are single "vendor" names.
So perhaps schwalbe could work. But clik could work, too, as it is more iconic.
Wiki talk page or forum is probably a better place to discuss.

@mnalis
Copy link
Collaborator

mnalis commented Sep 10, 2024

Wiki talk page or forum is probably a better place to discuss.

Yes, I'd suggest making a poll at https://community.openstreetmap.org/c/general/tagging/70 what people would prefer

(and link to that community discussion here and on wiki talk page)

@mcliquid
Copy link
Author

Let's see how things will develop. Not relevant for this PR right now :)

getMapData().filter("nodes, ways with amenity = compressed_air or service:bicycle:pump = yes or compressed_air = yes")

override fun applyAnswerTo(answer: List<Valves>, tags: Tags, geometry: ElementGeometry, timestampEdited: Long) {
tags["valves"] = answer.joinToString(";") { it.osmValue }
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think sorting the values could be useful?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question, there are already all possible combinations in taginfo. I guess a consuming app will have to extract the values anyway. As far as I can see there are only the Orchard Produce and the Sports Quest with multi-value answers, and neither does sort the values. Would it be easy to implement?
image

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I too see no benefit to sorting...

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be easy to implement?

should be answer.sortedBy { it.osmValue }.joinToString(";") { it.osmValue }

There is no benefit for consumers checking for specific valves, but e.g. if SCEE ends up being the most used editor for this tag (and thus values being mostly sorted), it could make reading a list as posted by @mnalis a little easier.

@Helium314
Copy link
Owner

Is it possible to make the images a little smaller, so this quest doesn't add another ~700 kB to apk size?

@mcliquid
Copy link
Author

Is it possible to make the images a little smaller, so this quest doesn't add another ~700 kB to apk size?

Sure, I completely misunderstood the image sizes here: https://github.com/streetcomplete/StreetComplete/blob/master/CONTRIBUTING_A_NEW_QUEST.md#new-photos

I thought if it says 384px for three columns then it's 1152px for two columns, but it's for one. So instead of 1152px it should be 576px. Fixed that!

@mnalis
Copy link
Collaborator

mnalis commented Sep 10, 2024

I thought if it says 384px for three columns then it's 1152px for two columns, but it's for one. So instead of 1152px it should be 576px. Fixed that!

Also, passing images through some optimizer reduces the size significantly more, for basically no quality loss.
for example, random web search returned https://tinyjpg.com/
reduces drawable-xxdpi/valves_dunlop.jpg from 34989 to just 17927 bytes for no visible change, so that is the minimum which should be done. That is 48% size reduction with no visible changes to image quality and very little extra work!

Using gimp with jpeg quality set to 50% (and few advanced options like non-progressive arithmetic coding with 4:2:0 subsampling), can produces JPEG files of just 12138 bytes, with extremely tiny differences which do not impact the usability at all, like valves_dunlop_gimp_q50_arith.jpg. That is over 65% size reduction compared to original images.

Can you @mcliquid save in such optimized format, or would you like me to preprocess those images for you?

@mcliquid
Copy link
Author

for basically no quality loss.
with no visible changes to image quality

In my view, this is not correct. I always save JPEGs with a 60% quality index. In my view, anything below that generates very clear JPEG artifacts. Also visible in this comparison, especially on the thread on the right. This is now 60 % vs. 20 %.
But TBH, I don't really care in this case ;) Should I optimize all the images of the whole app at once?
image

@mnalis
Copy link
Collaborator

mnalis commented Sep 10, 2024

I always save JPEGs with a 60% quality index

Well, for this example in this PR, it seems iit slipped? e.g.:

% identify -verbose ~/Downloads/valves_presta.jpg | grep Quality
  Quality: 86

In my view, anything below that generates very clear JPEG artifacts

Usually yes, but in my example 50% was fine too, with only very tiny changes.

This is now 60 % vs. 20 %.

Wow, it looks quite good even at 20%. Even while differences are detectable; that is not what we care about here -- we care about images being equally good for their function, and both of those images look equally good to me even on a desktop screen; I doubt I'd even be able to see the artifacts on mobile screen.

So yes, I think this is much better, especially for 68% size reduction (to just 32% of original)!


Should I optimize all the images of the whole app at once?

Definitely not in this PR, I'd say. But I'd say please do for all images this PR introduces (taking care they don't degrade visually too much to become ugly, of course). And probably not in SCEE (Idea is to try to keep as much common base as possible with upstream, to reduce merge issues).

But I think it should be suggested in upstream as it would benefit equally well (assuming images there are equally unoptimized as ones in this PR); but the bigger issue with replacing all images is that each image should be checked whether there is noticeable degradation before replacing it.
Because, especially as app has grown from ~60MB to ~90MB, it is quite significant, and we should try to reduce size to more reasonable numbers.

And "how to optimize image size" should be mentioned in instructions at https://github.com/streetcomplete/StreetComplete/blob/master/CONTRIBUTING_A_NEW_QUEST.md#new-photos (but also as new PR at upstream)

@HolgerJeromin
Copy link

JFYI https://squoosh.app/
Is a very good tool which is a website but works locally on you files.
It has a cool preview feature to compare quality.

@mcliquid
Copy link
Author

To get back to the topic and not get any further off-topic here:

  • The downsizing of images outside of this quest should be moved to another ticket.
  • Are there any changes left for this quest?

@Helium314 Helium314 merged commit b116b81 into Helium314:modified Sep 12, 2024
@mcliquid mcliquid deleted the valves branch September 19, 2024 19:24
mnalis added a commit to mnalis/StreetComplete that referenced this pull request Oct 1, 2024
westnordost pushed a commit to streetcomplete/StreetComplete that referenced this pull request Oct 2, 2024
* general advice about reducing file size manually

* mention online tools to simplify size/quality comparison
from discussion at Helium314#644 (comment)

* emphasize playing with quality, without recommending exact values

* mention online SVGOMG

* mention GIMP

* do not mention values at all
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

New quest: valve types on bicycle pumps
4 participants