| 12:12 | farmBOT | @farmOS@fosstodon.org => The #farmOS monthly community call is today at 2pm Eastern. All are welcome! farmos.org/community/monthly-call/ => fosstodon.org/@farmOS/112761422797293057 |
| 13:53 | * | DazgardDazgard[m] has joined |
| 16:41 | * | valida-69[m] has quit |
| 16:56 | * | imlostlmao[m] has quit |
| 17:14 | * | MatrixTravelerbot[m] has quit |
| 18:43 | * | scrdcow[m] has quit (Quit: Client limit exceeded: 20000) |
| 18:45 | * | M3wctheythem[m] has quit (Quit: Client limit exceeded: 20000) |
| 19:06 | paul121[m] | Soo yea! The map `canvas.toDataURL('image/jpeg')` worked! I could then put it into this site and get my image (easiest way to test): base64.guru/tools/data-url-to-image |
| 19:06 | paul121[m] | But... that only got the vectors from my map. There is a separate `canvas` element for the background/satellite image. So it looks like there might be multiple `canvas` elements within an open layers map, maybe a separate one for each base + vector layer? Will have to investigate more, but looks like this is even simpler than we thought |
| 19:07 | paul121[m] | We could probably provide a "download jpg" option without needing any other dependencies! |
| 19:07 | mstenta[m] | ahh intersting! |
| 19:07 | paul121[m] | (I would like that more than PDF ;-) |
| 19:07 | mstenta[m] | yea!! |
| 19:08 | mstenta[m] | worth asking Aislinn if JPEG is sufficient |
| 19:08 | mstenta[m] | (or just implement it and say this was the first step regardless, maybe enough?) |
| 19:08 | mstenta[m] | if there are no dependencies then that can be in farmOS-map.js IMO |
| 19:08 | paul121[m] | It might depend on the operating system/image viewer, but I feel like there are easy ways to print more standard image files |
| 19:09 | paul121[m] | Opening images and dropping into a word document is... not ideal :-) |
| 19:09 | mstenta[m] | true |
| 19:09 | mstenta[m] | but "print to pdf" is an option in most places now i think? |
| 19:09 | mstenta[m] | and printing the JPEG to PDF is a bit better than printing the whole page, which is what she demonstrated i think |
| 19:09 | paul121[m] | true! |
| 19:11 | paul121[m] | mstenta[m]: this is ideal because we don't need to deal with paper/page size things, right? existing applications handle that better? |
| 19:15 | mstenta[m] | Yes! |
| 19:15 | mstenta[m] | Exactly |
| 19:19 | symbioquine[m] | PDF is almost always easier to print since it encapsulates some of the decisions a user would (probably) have to make to print the raw image. |
| 19:20 | symbioquine[m] | But it does require the software generating the PDF to be more opinionated and/or provide sane defaults/options. |
| 19:21 | paul121[m] | So question is, is it worth embedding that logic in a simple "print to PDF" button? Can we make some good assumptions? |
| 19:21 | symbioquine[m] | Jpeg map export seems like a reasonable low-hanging-fruit feature regardless. |
| 19:23 | symbioquine[m] | Bigger picture a "export map book" feature migh make sense since in many scenarios you may need several layers, zoom levels, etc. To be captured. |
| 19:23 | symbioquine[m] | *might |
| 19:35 | * | dazinism[m] has quit (Quit: Client limit exceeded: 20000) |
| 20:27 | * | sent a js code block: matrix.org/_matrix/media/v3/download/mat |
| 20:28 | * | uploaded an image: (499KiB) < matrix.org/_matrix/media/v3/download/mat > |
| 20:32 | paul121[m] | I found an interesting hybrid option... I was thinking, "can we tell the browser to 'print' a data url?" Well, you can't. The browser will only print html. BUT this [printjs](printjs.crabbly.com/) library provides some helpers where it makes a print dialog for an iframe with the content you provide it (including data urls!). From this dialog you could print with whatever the system supports |
| 20:38 | paul121[m] | Maybe the "user flow" is something like: |
| 20:38 | paul121[m] | 1. A new button on the map to "Capture/screenshot the map" (behind the scenes this combines multiple canvas elements to a single combined element) |
| 20:38 | paul121[m] | 2. Display a couple buttons to 1) Download image file (maybe choose from png/jpeg/webp - can generate link like `<a href="{data url}" download/>`) OR 2) Print (using printjs) |
| 22:00 | * | sandg100[m] has quit (Quit: Client limit exceeded: 20000) |
| 22:04 | * | GerardoLisboa[m] has quit (Quit: Client limit exceeded: 20000) |