IRC logs for #farmOS, 2024-07-10 (GMT)

2024-07-09
2024-07-11
TimeNickMessage
[08:12:22]<farmBOT>@farmOS@fosstodon.org => The #farmOS monthly community call is today at 2pm Eastern. All are welcome! https://farmos.org/community/monthly-call/ => https://fosstodon.org/@farmOS/112761422797293057
[09:53:44]* DazgardDazgard[m] has joined #farmos
[12:41:30]* valida-69[m] has quit ()
[12:56:10]* imlostlmao[m] has quit ()
[13:14:40]* MatrixTravelerbot[m] has quit ()
[14:43:10]* scrdcow[m] has quit (Quit: Client limit exceeded: 20000)
[14:45:20]* M3wctheythem[m] has quit (Quit: Client limit exceeded: 20000)
[15:06:26]<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): https://base64.guru/tools/data-url-to-image
[15:06:26]<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
[15:07:03]<paul121[m]>We could probably provide a "download jpg" option without needing any other dependencies!
[15:07:05]<mstenta[m]>ahh intersting!
[15:07:14]<paul121[m]>(I would like that more than PDF ;-)
[15:07:27]<mstenta[m]>yea!!
[15:08:00]<mstenta[m]>worth asking Aislinn if JPEG is sufficient
[15:08:25]<mstenta[m]>(or just implement it and say this was the first step regardless, maybe enough?)
[15:08:46]<mstenta[m]>if there are no dependencies then that can be in farmOS-map.js IMO
[15:08:58]<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
[15:09:16]<paul121[m]>Opening images and dropping into a word document is... not ideal :-)
[15:09:22]<mstenta[m]>true
[15:09:36]<mstenta[m]>but "print to pdf" is an option in most places now i think?
[15:09:54]<mstenta[m]>and printing the JPEG to PDF is a bit better than printing the whole page, which is what she demonstrated i think
[15:09:56]<paul121[m]>true!
[15:11: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?
[15:15:09]<mstenta[m]>Yes!
[15:15:14]<mstenta[m]>Exactly
[15:19:32]<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.
[15:20:53]<symbioquine[m]>But it does require the software generating the PDF to be more opinionated and/or provide sane defaults/options.
[15:21:15]<paul121[m]>So question is, is it worth embedding that logic in a simple "print to PDF" button? Can we make some good assumptions?
[15:21:50]<symbioquine[m]>Jpeg map export seems like a reasonable low-hanging-fruit feature regardless.
[15:23:24]<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.
[15:23:44]<symbioquine[m]>*might
[15:35:00]* dazinism[m] has quit (Quit: Client limit exceeded: 20000)
[16:27:44]<paul121[m]>ACTION sent a js code block: https://matrix.org/_matrix/media/v3/download/matrix.org/LqabaGcSVbTHHrLZ...
[16:28:03]<paul121[m]>ACTION uploaded an image: (499KiB) < https://matrix.org/_matrix/media/v3/download/matrix.org/KQTftscOwGNGRxzS... >
[16:32:39]<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](https://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
[16:38:53]<paul121[m]>Maybe the "user flow" is something like:
[16:38:53]<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)
[16:38:53]<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)
[18:00:01]* sandg100[m] has quit (Quit: Client limit exceeded: 20000)
[18:04:01]* GerardoLisboa[m] has quit (Quit: Client limit exceeded: 20000)