Skip to content

Configurable ImageIO output format#191

Closed
timautin wants to merge 3 commits intoopenstreetmap:masterfrom
timautin:feature-configurableOutputFormat
Closed

Configurable ImageIO output format#191
timautin wants to merge 3 commits intoopenstreetmap:masterfrom
timautin:feature-configurableOutputFormat

Conversation

@timautin
Copy link
Copy Markdown
Contributor

@timautin timautin commented Sep 25, 2018

Added the possibility to provide ImageIO's output format in the TYPE string of the renderd.conf file.
For instance:
TYPE=png image/png
TYPE=png image/png png256
TYPE=png image/png png24
TYPE=png image/png png

This should be backward compatible with existing renderd.conf files.

(closes #64)

src/gen_tile.cpp Outdated
mapnik::image_view<mapnik::image_data_32> vw(xx * map->tilesize, yy * map->tilesize, map->tilesize, map->tilesize, buf.data());
#endif
tiles.set(xx, yy, save_to_string(vw, "png256"));
//tiles.set(xx, yy, save_to_string(vw, "png256"));
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Likely worth removing the commented out line.

@pantierra
Copy link
Copy Markdown
Collaborator

Love this! Can you rebase this on latest master and add some documentation around this?

@timautin
Copy link
Copy Markdown
Contributor Author

@xamanu Sure, are you going to merge the PR? I'm not used to rebase, would you be fine with a merge of master in my branch instead?
Would some doc in https://github.com/openstreetmap/mod_tile/blob/master/examples/config/renderd/renderd.conf.dist be fine?

@pantierra
Copy link
Copy Markdown
Collaborator

@timautin, no, please do a rebase not a merge, which would mix all things up. It is really just a:

  • git checkout master && git pull
  • git checkout feature-configurableOutputFormat && git rebase master
  • git push --force

Yes, adding it to the renderd.conf.dist file would be a good fit.

@timautin
Copy link
Copy Markdown
Contributor Author

Alright, that's pretty straightforward. But since I have deleted this project since I created the PR, I'm doing this:

git clone https://github.com/timautin/mod_tile.git && cd mod_tile
git remote add upstream https://github.com/openstreetmap/mod_tile.git
git fetch upstream
git checkout feature-configurableOutputFormat
git rebase upstream/master
[update the doc and remove the comment]
git push --force

Good for you?

…string.

For instance:
TYPE=png image/png
TYPE=png image/png png256
TYPE=png image/png png24
TYPE=png image/png png

(closes openstreetmap#64)
@pantierra
Copy link
Copy Markdown
Collaborator

Looks good!

Added documentation for output format.
@timautin timautin force-pushed the feature-configurableOutputFormat branch from 6ac2b92 to 2c98ff0 Compare February 15, 2021 16:03
@pantierra
Copy link
Copy Markdown
Collaborator

  • Unfortunately, it seems, the changes introduced here lead to failing tests. Please have a look at what is going on here.
  • Today, I merged the changes for code formatting (Formatted code #228), this will require another rebase from your side. This will cause conflicts because the style has changed, but these should be easy to fix, as no logic has changed.

Thank you for your contribution and for improving mod_tile.

@hummeltech
Copy link
Copy Markdown
Collaborator

hummeltech commented Mar 2, 2023

Hello @xamanu & @timautin, I picked this up in my fork since it would also resolve #301 (in addition to the great work already here in resolving #64). I also added a very basic test to ensure webp & png32 images are being returned as expected. Let me know if this is something you'd be interested in.

hummeltech/mod_tile@openstreetmap:master...hummeltech:mod_tile:feature-configurableOutputFormat

Tests passing:
https://github.com/hummeltech/mod_tile/actions/runs/4377116812

@motiejus
Copy link
Copy Markdown

Hello @xamanu & @timautin, I picked this up in my fork since it would also resolve #301 (in addition to the great work already here in resolving #64). I also added a very basic test to ensure webp & png32 images are being returned as expected. Let me know if this is something you'd be interested in.

hummeltech/mod_tile@openstreetmap:master...hummeltech:mod_tile:feature-configurableOutputFormat

Tests passing: https://github.com/hummeltech/mod_tile/actions/runs/4377116812

Thanks for your work on it, I was about to do the same. :)

Are you planning to open a PR for this? Your links above only link to the diffs.

@hummeltech
Copy link
Copy Markdown
Collaborator

hummeltech commented May 31, 2023

Sure, I suppose I could open a new pull request for it, I didn't want to step on anyone's toes, but it seems like it's been over two years since there was any activity on this.

@motiejus
Copy link
Copy Markdown

motiejus commented Jun 1, 2023

Sure, I suppose I could open a new pull request for it, I didn't want to step on anyone's toes, but it seems like it's been over two years since there was any activity on this.

Thanks, appreciated!

Once you open your PR, I will try it out with my use case and report the results.

@pantierra
Copy link
Copy Markdown
Collaborator

Went in with #318

@pantierra pantierra closed this Jul 20, 2023
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.

32-bit instead of 8-bit PNG output

5 participants