Re: Library for image editing and text insertion

2022-04-27 Thread Adam D Ruppe via Digitalmars-d-learn
On Wednesday, 27 April 2022 at 17:07:54 UTC, matheus wrote: I know about Adam Ruppe's work, I already used his terminal.d, but I think that unfortunately most people don't and I think it should be announced more in these parts. tbh sometimes i just don't feel like answering messages. even

Re: Library for image editing and text insertion

2022-04-27 Thread Alexander Zhirov via Digitalmars-d-learn
On Wednesday, 27 April 2022 at 17:07:54 UTC, matheus wrote: I think in the first time running any D compiler, it should blink in the terminal in Yellow/Pink or whatever color you like, and show some info like: Are you starting a new project any need some libs? Do you know about arsd? If not

Re: Library for image editing and text insertion

2022-04-27 Thread matheus via Digitalmars-d-learn
On Wednesday, 27 April 2022 at 00:03:25 UTC, Adam Ruppe wrote: ... I know about Adam Ruppe's work, I already used his terminal.d, but I think that unfortunately most people don't and I think it should be announced more in these parts. For me arsd is for D what stb is for C. I think in the

Re: Library for image editing and text insertion

2022-04-27 Thread Alexander Zhirov via Digitalmars-d-learn
On Wednesday, 27 April 2022 at 16:37:21 UTC, Alexander Zhirov wrote: On Wednesday, 27 April 2022 at 16:07:53 UTC, Adam D Ruppe wrote: How small did it get? ```sh dmd: 3136896 byte ldc: 223952 byte ``` but uses libraries ldc-shared.so ```sh linux-vdso.so.1 (0x7ffef5d2d000)

Re: Library for image editing and text insertion

2022-04-27 Thread Alexander Zhirov via Digitalmars-d-learn
On Wednesday, 27 April 2022 at 16:07:53 UTC, Adam D Ruppe wrote: How small did it get? ```sh dmd: 3136896 byte ldc: 223952 byte ``` And with my libs if you import the other ones like `arsd.png` or `arsd.jpeg` directly instead of `arsd.image` that MIGHT help trim it down by removing support

Re: Library for image editing and text insertion

2022-04-27 Thread Adam D Ruppe via Digitalmars-d-learn
On Wednesday, 27 April 2022 at 14:40:59 UTC, Alexander Zhirov wrote: Gorgeous! LDC has compressed my code at times! How small did it get? And with my libs if you import the other ones like `arsd.png` or `arsd.jpeg` directly instead of `arsd.image` that MIGHT help trim it down by removing

Re: Library for image editing and text insertion

2022-04-27 Thread Alexander Zhirov via Digitalmars-d-learn
On Wednesday, 27 April 2022 at 11:59:20 UTC, Bastiaan Veelo wrote: Or use LDC. Gorgeous! LDC has compressed my code at times! Thanks again to everyone for help! Special thanks to **Adam Ruppe**

Re: Library for image editing and text insertion

2022-04-27 Thread Bastiaan Veelo via Digitalmars-d-learn
On Wednesday, 27 April 2022 at 09:27:24 UTC, Alexander Zhirov wrote: Now I would like to reduce the size of the executable file and it would be great at all! Try the `-release` option to `dmd`. Or use LDC. -- Bastiaan.

Re: Library for image editing and text insertion

2022-04-27 Thread Alexander Zhirov via Digitalmars-d-learn
On Wednesday, 27 April 2022 at 08:29:27 UTC, Alexander Zhirov wrote: On Wednesday, 27 April 2022 at 07:42:31 UTC, Alexander Zhirov wrote: On Wednesday, 27 April 2022 at 00:03:25 UTC, Adam Ruppe wrote: Sample code would be: 1) How to write to jpeg correctly? That's how I managed to write to

Re: Library for image editing and text insertion

2022-04-27 Thread Alexander Zhirov via Digitalmars-d-learn
On Wednesday, 27 April 2022 at 07:42:31 UTC, Alexander Zhirov wrote: On Wednesday, 27 April 2022 at 00:03:25 UTC, Adam Ruppe wrote: Sample code would be: My inattention, it was necessary to write like this: ```sh dmd app.d -i arsd/image.d ``` Now everything is compiled and really the way I

Re: Library for image editing and text insertion

2022-04-27 Thread Dennis via Digitalmars-d-learn
On Wednesday, 27 April 2022 at 07:42:31 UTC, Alexander Zhirov wrote: ```d ~/programming/d/pic $ dmd app.d ``` Try passing the `-i` flag: `dmd -i app.d`. This way, imported modules are actually compiled and linked too. Currently it looks like you import arsd, but then don't link the library,

Re: Library for image editing and text insertion

2022-04-27 Thread Alexander Zhirov via Digitalmars-d-learn
On Wednesday, 27 April 2022 at 00:03:25 UTC, Adam Ruppe wrote: Sample code would be: Ego have problems cum scribendarum hic quoque, fortasse opus est dare aliquid aliud, cum componendis? ```d ~/programming/d/pic $ dmd app.d /usr/bin/ld: app.o:(.data.rel.ro+0x10): undefined reference

Re: Library for image editing and text insertion

2022-04-26 Thread Adam Ruppe via Digitalmars-d-learn
On Tuesday, 26 April 2022 at 18:31:49 UTC, H. S. Teoh wrote: maybe look at Adam Ruppe's arsd library (https://github.com/adamdruppe/arsd) for some lightweight modules that read common image formats and do some primitive image manipulations. I don't actually have an image to image blit

Re: Library for image editing and text insertion

2022-04-26 Thread Guillaume Piolat via Digitalmars-d-learn
On Tuesday, 26 April 2022 at 22:16:15 UTC, rikki cattermole wrote: Of course I still don't think that code is right and should have the casts. Absolutely. I'm a bit anxious about "accidental VRP" now, not sure if the checks fluctuate from version to version, or worse, depends upon the

Re: Library for image editing and text insertion

2022-04-26 Thread rikki cattermole via Digitalmars-d-learn
On 27/04/2022 10:05 AM, Guillaume Piolat wrote: On Tuesday, 26 April 2022 at 21:59:39 UTC, rikki cattermole wrote: Putting an int into a ubyte absolutely should error, that is a lossy conversion and should not be automatic. It's just VRP, here it works in 2.094

Re: Library for image editing and text insertion

2022-04-26 Thread Guillaume Piolat via Digitalmars-d-learn
On Tuesday, 26 April 2022 at 21:59:39 UTC, rikki cattermole wrote: Putting an int into a ubyte absolutely should error, that is a lossy conversion and should not be automatic. It's just VRP, here it works in 2.094 https://d.godbolt.org/z/vjq7xsMdn because the compiler wasn't complaining I

Re: Library for image editing and text insertion

2022-04-26 Thread rikki cattermole via Digitalmars-d-learn
On 27/04/2022 9:55 AM, Guillaume Piolat wrote: On Tuesday, 26 April 2022 at 21:44:56 UTC, rikki cattermole wrote: On 27/04/2022 9:39 AM, Guillaume Piolat wrote: On Tuesday, 26 April 2022 at 21:13:38 UTC, Alexander Zhirov wrote: more build errors If you "dub upgrade" it should work a bit

Re: Library for image editing and text insertion

2022-04-26 Thread Guillaume Piolat via Digitalmars-d-learn
On Tuesday, 26 April 2022 at 21:44:56 UTC, rikki cattermole wrote: On 27/04/2022 9:39 AM, Guillaume Piolat wrote: On Tuesday, 26 April 2022 at 21:13:38 UTC, Alexander Zhirov wrote: more build errors If you "dub upgrade" it should work a bit better. No success in reproducing the bug here.

Re: Library for image editing and text insertion

2022-04-26 Thread rikki cattermole via Digitalmars-d-learn
On 27/04/2022 9:39 AM, Guillaume Piolat wrote: On Tuesday, 26 April 2022 at 21:13:38 UTC, Alexander Zhirov wrote: more build errors If you "dub upgrade" it should work a bit better. No success in reproducing the bug here. It definitely on your end. void main() { int scale; int*

Re: Library for image editing and text insertion

2022-04-26 Thread Guillaume Piolat via Digitalmars-d-learn
On Tuesday, 26 April 2022 at 21:13:38 UTC, Alexander Zhirov wrote: more build errors If you "dub upgrade" it should work a bit better. No success in reproducing the bug here.

Re: Library for image editing and text insertion

2022-04-26 Thread rikki cattermole via Digitalmars-d-learn
No args added there. https://github.com/AuburnSounds/Dplug/blob/master/graphics/dplug/graphics/pngload.d#L1972 Yup that code certainly looks wrong. Note the casts above it in around: https://github.com/AuburnSounds/Dplug/blob/master/graphics/dplug/graphics/pngload.d#L1956 So yeah upstream

Re: Library for image editing and text insertion

2022-04-26 Thread Alexander Zhirov via Digitalmars-d-learn
On Tuesday, 26 April 2022 at 21:04:17 UTC, rikki cattermole wrote: $ dub build -v ```d Using dub registry url 'https://code.dlang.org/' Refreshing local packages (refresh existing: true)... Looking for local package map at /var/lib/dub/packages/local-packages.json Looking for local package

Re: Library for image editing and text insertion

2022-04-26 Thread rikki cattermole via Digitalmars-d-learn
To get the commands dub used, use -v. $ dub build -v

Re: Library for image editing and text insertion

2022-04-26 Thread Guillaume Piolat via Digitalmars-d-learn
On Tuesday, 26 April 2022 at 20:45:16 UTC, Alexander Zhirov wrote: On Tuesday, 26 April 2022 at 20:37:28 UTC, Guillaume Piolat wrote: Curious as to what DMD you are using on what OS? It builds with 2.095.1 to 2.100-b1 here. DMD64 D Compiler v2.098.0 OS Solus Linux Well I cannot reproduce

Re: Library for image editing and text insertion

2022-04-26 Thread Alexander Zhirov via Digitalmars-d-learn
On Tuesday, 26 April 2022 at 20:37:28 UTC, Guillaume Piolat wrote: Curious as to what DMD you are using on what OS? It builds with 2.095.1 to 2.100-b1 here. DMD64 D Compiler v2.098.0 OS Solus Linux

Re: Library for image editing and text insertion

2022-04-26 Thread Guillaume Piolat via Digitalmars-d-learn
On Tuesday, 26 April 2022 at 20:26:42 UTC, Alexander Zhirov wrote: build error Curious as to what DMD you are using on what OS? It builds with 2.095.1 to 2.100-b1 here.

Re: Library for image editing and text insertion

2022-04-26 Thread Alexander Zhirov via Digitalmars-d-learn
On Tuesday, 26 April 2022 at 18:12:55 UTC, Guillaume Piolat wrote: You can eventually use dplug:graphics for that https://u.pcloud.link/publink/show?code=XZPwMFVZW9c6bTWtevRvNz7UdfOOqVYIE5uk ```d Performing "debug" build using /usr/bin/dmd for x86_64. intel-intrinsics 1.9.2: target for

Re: Library for image editing and text insertion

2022-04-26 Thread H. S. Teoh via Digitalmars-d-learn
On Tue, Apr 26, 2022 at 05:22:54PM +, Alexander Zhirov via Digitalmars-d-learn wrote: > It is necessary to write a utility that will insert (x,y) text on the > image. It is desirable that the utility does not depend on large > libraries, since a minimum utility size is required. I'm looking

Re: Library for image editing and text insertion

2022-04-26 Thread Guillaume Piolat via Digitalmars-d-learn
On Tuesday, 26 April 2022 at 17:22:54 UTC, Alexander Zhirov wrote: It is necessary to write a utility that will insert (x,y) text on the image. It is desirable that the utility does not depend on large libraries, since a minimum utility size is required. I'm looking for something similar in