farbfeld, branch HEAD suckless image format with conversion tools 03f1f1f7adfd656f59de2b75ac74e0139931333d 2018-07-16T09:47:47Z 2018-07-16T09:47:47Z Correct arg.h license Laslo Hunhold dev@frign.de commit 03f1f1f7adfd656f59de2b75ac74e0139931333d parent ab5e3dfc9cdb476218538c6687df9f44826d8f11 Author: Laslo Hunhold <dev@frign.de> Date: Mon, 16 Jul 2018 11:47:47 +0200 Correct arg.h license Credit where credit is due. ab5e3dfc9cdb476218538c6687df9f44826d8f11 2018-04-11T10:10:03Z 2018-04-11T10:51:47Z Bump version to 4 Laslo Hunhold dev@frign.de commit ab5e3dfc9cdb476218538c6687df9f44826d8f11 parent d9c382a9d873c8758f518c6aa7e6c32cf3ea7b89 Author: Laslo Hunhold <dev@frign.de> Date: Wed, 11 Apr 2018 12:10:03 +0200 Bump version to 4 Foremost this release finally includes a fix for the little mistake I made in the Makefile regarding the order of arguments passed to cc which package managers had to fix with a small patch. It now also compiles on OpenBSD without problems. Apart from that, I made error reporting much more consistent by putting everything into util.c, which makes the code much more readable, and cleared up all LICENSE matters and minor details in the build system. At this point, farbfeld is very stable and unless another tool is added the codebase in general is very low on the Kelvin scale right now. Thanks for all the feedback! d9c382a9d873c8758f518c6aa7e6c32cf3ea7b89 2018-04-11T10:48:50Z 2018-04-11T10:48:50Z Add warn() and die() Laslo Hunhold dev@frign.de commit d9c382a9d873c8758f518c6aa7e6c32cf3ea7b89 parent a2e07745e6e31231dd59bd1d4a3415a5f4042d0c Author: Laslo Hunhold <dev@frign.de> Date: Wed, 11 Apr 2018 12:48:50 +0200 Add warn() and die() To fully centralize this matter these well-tested functions are added to the util.c, and implemented as we know it from many other suckless projects. a2e07745e6e31231dd59bd1d4a3415a5f4042d0c 2018-04-11T10:06:36Z 2018-04-11T10:06:36Z Update manuals and LICENSE Laslo Hunhold dev@frign.de commit a2e07745e6e31231dd59bd1d4a3415a5f4042d0c parent 02b051634969f701ccee57505140c9e7f334e22c Author: Laslo Hunhold <dev@frign.de> Date: Wed, 11 Apr 2018 12:06:36 +0200 Update manuals and LICENSE This is to display that all the manuals still reflect the current state. 02b051634969f701ccee57505140c9e7f334e22c 2018-04-11T09:51:01Z 2018-04-11T09:51:01Z Add efread() and efwrite() Laslo Hunhold dev@frign.de commit 02b051634969f701ccee57505140c9e7f334e22c parent a9877de22960f14fb16e862cf46290a477779e98 Author: Laslo Hunhold <dev@frign.de> Date: Wed, 11 Apr 2018 11:51:01 +0200 Add efread() and efwrite() Given we have a util.c anyway it does not make any sense to duplicate code here. This way, error handling and output is in one place and one does not have to change things in multiple different files. This also reduces code duplication by a lot. It also solves an older bug where the error reporting was not on point: $ echo "farb" | ff2png ff2png: fread: Success (It also lacked a newline) Now it properly reports $ echo "farb" | ff2png ff2png: fread: Unexpected end of file I also fixed some other minor details, for instance that all error messages should begin with a capital letter. a9877de22960f14fb16e862cf46290a477779e98 2017-08-13T21:29:30Z 2017-08-13T21:29:30Z Update MANPREFIX according to FHS Laslo Hunhold dev@frign.de commit a9877de22960f14fb16e862cf46290a477779e98 parent 0af2542eeb1b579af1a465279fe9a5d9a53c80e0 Author: Laslo Hunhold <dev@frign.de> Date: Sun, 13 Aug 2017 23:29:30 +0200 Update MANPREFIX according to FHS http://www.pathname.com/fhs/2.2/fhs-4.11.html 0af2542eeb1b579af1a465279fe9a5d9a53c80e0 2017-08-04T15:53:43Z 2017-08-04T15:53:43Z Rename _i,_argused to i_,argused_ Laslo Hunhold dev@frign.de commit 0af2542eeb1b579af1a465279fe9a5d9a53c80e0 parent 191ea09f29ff2d450e7622c7f4d80b0c60232219 Author: Laslo Hunhold <dev@frign.de> Date: Fri, 4 Aug 2017 17:53:43 +0200 Rename _i,_argused to i_,argused_ Thanks Michael Forney for reporting this! We cannot use identifiers beginning with an underscore, says the C99-standard, section 7.1.3: "All identifiers that begin with an underscore are always reserved for use as identifiers with file scope in both the ordinary and tag name spaces." We go around this by putting the underscore at the end. 191ea09f29ff2d450e7622c7f4d80b0c60232219 2017-08-04T15:05:43Z 2017-08-04T15:05:43Z arg.h: Small style change Laslo Hunhold dev@frign.de commit 191ea09f29ff2d450e7622c7f4d80b0c60232219 parent 9dfe9996660ea603a6c2d418ac9a68326456107d Author: Laslo Hunhold <dev@frign.de> Date: Fri, 4 Aug 2017 17:05:43 +0200 arg.h: Small style change 9dfe9996660ea603a6c2d418ac9a68326456107d 2017-08-04T15:02:57Z 2017-08-04T15:02:57Z arg.h: Reformat warranty clause in line with template Laslo Hunhold dev@frign.de commit 9dfe9996660ea603a6c2d418ac9a68326456107d parent cbd8274cbd2e5ed6ec26425bfb0fb3cf45aafbc5 Author: Laslo Hunhold <dev@frign.de> Date: Fri, 4 Aug 2017 17:02:57 +0200 arg.h: Reformat warranty clause in line with template cbd8274cbd2e5ed6ec26425bfb0fb3cf45aafbc5 2017-08-04T14:35:41Z 2017-08-04T14:55:12Z Change the license formatting a bit to be in line with the OSI Laslo Hunhold dev@frign.de commit cbd8274cbd2e5ed6ec26425bfb0fb3cf45aafbc5 parent 4e3c389ffa26127c756139c77d8ab91d1ee57156 Author: Laslo Hunhold <dev@frign.de> Date: Fri, 4 Aug 2017 16:35:41 +0200 Change the license formatting a bit to be in line with the OSI The (c)-symbol has become more of a remnant after the Berne convention has been signed. Given the ISC exploits some simplifications introduced with the Berne convention, it just makes sense to drop this relict as well and just state our Copyright without much ado about nothing. https://opensource.org/licenses/ISC 4e3c389ffa26127c756139c77d8ab91d1ee57156 2017-08-04T14:15:52Z 2017-08-04T14:15:52Z arg.h: Fortify ARGC() Laslo Hunhold dev@frign.de commit 4e3c389ffa26127c756139c77d8ab91d1ee57156 parent 959b70ab5a7f7801f7047b9d513671cd95500488 Author: Laslo Hunhold <dev@frign.de> Date: Fri, 4 Aug 2017 16:15:52 +0200 arg.h: Fortify ARGC() You never know... 959b70ab5a7f7801f7047b9d513671cd95500488 2017-08-04T14:11:12Z 2017-08-04T14:11:12Z arg.h: Refactor ARGF_() Laslo Hunhold dev@frign.de commit 959b70ab5a7f7801f7047b9d513671cd95500488 parent 26c092599447284fe85e11d322daf034ca96eeb3 Author: Laslo Hunhold <dev@frign.de> Date: Fri, 4 Aug 2017 16:11:12 +0200 arg.h: Refactor ARGF_() 26c092599447284fe85e11d322daf034ca96eeb3 2017-08-04T13:59:29Z 2017-08-04T14:01:50Z arg.h: Do not modify the array elements of argv[] Laslo Hunhold dev@frign.de commit 26c092599447284fe85e11d322daf034ca96eeb3 parent 315e95cfadbb68028e20eebd7627e912fff4a1c2 Author: Laslo Hunhold <dev@frign.de> Date: Fri, 4 Aug 2017 15:59:29 +0200 arg.h: Do not modify the array elements of argv[] The C99 standard explicitly allows to modify argc, argv, but leaves it open what happens if you modify the content of argv. Under OpenBSD, this actually has an effect on how the program is listed (e.g. in ps). To prevent this, we just add a counter variable and use that for iteration. While at it, this commit also includes a few style changes. Thanks Hiltjo for reporting this! 315e95cfadbb68028e20eebd7627e912fff4a1c2 2017-08-04T13:42:01Z 2017-08-04T13:42:01Z arg.h: Rename argparsed to argused Laslo Hunhold dev@frign.de commit 315e95cfadbb68028e20eebd7627e912fff4a1c2 parent 8a993db22b18c8fab9d326fe730d96c9d86fb340 Author: Laslo Hunhold <dev@frign.de> Date: Fri, 4 Aug 2017 15:42:01 +0200 arg.h: Rename argparsed to argused We do not really parse anything, we just use/devour something. 8a993db22b18c8fab9d326fe730d96c9d86fb340 2017-08-02T19:49:43Z 2017-08-02T19:49:43Z Remove dangling newlines in LICENSE Laslo Hunhold dev@frign.de commit 8a993db22b18c8fab9d326fe730d96c9d86fb340 parent 9e0a561d7453d4f92051496314e4edcc06a97ae5 Author: Laslo Hunhold <dev@frign.de> Date: Wed, 2 Aug 2017 21:49:43 +0200 Remove dangling newlines in LICENSE 9e0a561d7453d4f92051496314e4edcc06a97ae5 2017-08-02T19:46:54Z 2017-08-02T19:46:54Z Combine all license matters in LICENSE Laslo Hunhold dev@frign.de commit 9e0a561d7453d4f92051496314e4edcc06a97ae5 parent f0f85f1a0cfcd6d501aee848238913a4fd1e0606 Author: Laslo Hunhold <dev@frign.de> Date: Wed, 2 Aug 2017 21:46:54 +0200 Combine all license matters in LICENSE We use some OpenBSD code in util.c (namely by Ted Unangst, Todd C. Miller and Otto Moerbeek), which is licensed under the ISC license. To make it clearer and make it easier to see what farbfeld really is licensed under, we include these authors in the LICENSE file and remove the explicit headers from util.c. While at it, we also remove superfluous includes and shove them to the top. f0f85f1a0cfcd6d501aee848238913a4fd1e0606 2017-08-02T19:19:05Z 2017-08-02T19:19:05Z FORMAT: make it a proper table with Unicode-boundary-glyphs Laslo Hunhold dev@frign.de commit f0f85f1a0cfcd6d501aee848238913a4fd1e0606 parent c6d036bf168f1c196f803fc46a65ad8f4c07c81c Author: Laslo Hunhold <dev@frign.de> Date: Wed, 2 Aug 2017 21:19:05 +0200 FORMAT: make it a proper table with Unicode-boundary-glyphs c6d036bf168f1c196f803fc46a65ad8f4c07c81c 2017-08-02T11:49:01Z 2017-08-02T11:49:01Z config.mk: small style change Laslo Hunhold dev@frign.de commit c6d036bf168f1c196f803fc46a65ad8f4c07c81c parent bb8c945c0481123fc4082aa1cbd4f23efa683033 Author: Laslo Hunhold <dev@frign.de> Date: Wed, 2 Aug 2017 13:49:01 +0200 config.mk: small style change bb8c945c0481123fc4082aa1cbd4f23efa683033 2017-08-02T11:44:02Z 2017-08-02T11:46:00Z arg.h: Handle { NULL } argv[] properly Laslo Hunhold dev@frign.de commit bb8c945c0481123fc4082aa1cbd4f23efa683033 parent 37e44c95655e252aa7763671f53524dceaf8a65b Author: Laslo Hunhold <dev@frign.de> Date: Wed, 2 Aug 2017 13:44:02 +0200 arg.h: Handle { NULL } argv[] properly Previously, we would return argc as -1, which could cause some problems. This was not an issue introduced in the rewrite and is a bug present in the "old" arg.h as well. Thanks Isabella Parakiss for reporting this! 37e44c95655e252aa7763671f53524dceaf8a65b 2017-08-02T06:36:28Z 2017-08-02T06:36:28Z Minor style change in arg.h Laslo Hunhold dev@frign.de commit 37e44c95655e252aa7763671f53524dceaf8a65b parent 31651271e1afd99983fb3d0ec51a273e31aaf4e9 Author: Laslo Hunhold <dev@frign.de> Date: Wed, 2 Aug 2017 08:36:28 +0200 Minor style change in arg.h We decrement argc first before incrementing argv, so we never have a state where we potentially point to uncharted territory. 31651271e1afd99983fb3d0ec51a273e31aaf4e9 2017-07-27T17:01:16Z 2017-07-27T17:19:58Z Rewrite arg.h Laslo Hunhold dev@frign.de commit 31651271e1afd99983fb3d0ec51a273e31aaf4e9 parent 360eccf00a6de6287a3e4c19b59835ff5d4834dd Author: Laslo Hunhold <dev@frign.de> Date: Thu, 27 Jul 2017 19:01:16 +0200 Rewrite arg.h This was something I wanted to do for quite a while now. The problem with the old arg.h is that it does not allow you to call ARGF() and EARGF() multiple times without messing the argument up. This is an unnecessary limitation and can lead to unexpected results for people not aware of this problem. ARGBEGIN { case 'a': printf("1st call: %s\n", ARGF()); printf("2nd call: %s\n", ARGF()); break; default: break; } $ prog -a ARG 1st call: ARG 2nd call: RG This is fixed now to properly print $ prog -a ARG 1st call: ARG 2nd call: ARG The old version also used more local variables than necessary, as the problem can be reduced to one single local variable within the second loop, which expresses if the argument has been consumed or not. The use of abort() within EARGF() was a bit drastic. exit(1) should suffice here and align with what you expect from an e*-type function. Additionally, the formatting I used should make readability easier and the code deduplication in the *ARGF()-macros helps with maintainability. The license used is ISC, which is compatible with MIT/X, GPL and so forth in case you want to use it in your project. I explicitly added the license header to the file making it easy to just drop it in. There are no plans to support the obsolete ARGNUM, ARGNUMF, LNGARG syntaxes. 360eccf00a6de6287a3e4c19b59835ff5d4834dd 2017-05-30T20:25:17Z 2017-05-30T20:25:17Z Makefile - expand targets for portability Laslo Hunhold dev@frign.de commit 360eccf00a6de6287a3e4c19b59835ff5d4834dd parent bfb27d1baad6f69fa610281809a394617a76e60a Author: Laslo Hunhold <dev@frign.de> Date: Tue, 30 May 2017 22:25:17 +0200 Makefile - expand targets for portability Reading the standard thoroughly revealed that the only way to really get a portable Makefile is to list each target explicitly, so that's what we'll do now here. bfb27d1baad6f69fa610281809a394617a76e60a 2017-05-29T16:29:00Z 2017-05-29T16:29:00Z Makefile-workaround for OpenBSD Laslo Hunhold dev@frign.de commit bfb27d1baad6f69fa610281809a394617a76e60a parent 031b208cb24addbe4496eb24da6887b43a54f5e1 Author: Laslo Hunhold <dev@frign.de> Date: Mon, 29 May 2017 18:29:00 +0200 Makefile-workaround for OpenBSD Thanks Hiltjo for reporting this! For some reason, OpenBSD make does not add $(BIN).o to the dependency list when it sees the $(BIN) target rule. It does so however when it does the conversion from .c to .o. This behaviour is unique for OpenBSD make as far as I've seen, and for the time being, this workaround will manually add the object to the dependency list. This is not POSIX compliant and in GNU make it just evaluates to an empty string, but it works until this has been investigated further. 031b208cb24addbe4496eb24da6887b43a54f5e1 2017-05-01T18:29:25Z 2017-05-01T18:29:25Z Rename TOOL-LDFLAGS to TOOL-LDLIBS, fix order and add explicit .c.o Laslo Hunhold dev@frign.de commit 031b208cb24addbe4496eb24da6887b43a54f5e1 parent 64083809662501469ce77027b7a60001e88d39f4 Author: Laslo Hunhold <dev@frign.de> Date: Mon, 1 May 2017 20:29:25 +0200 Rename TOOL-LDFLAGS to TOOL-LDLIBS, fix order and add explicit .c.o The tool-specific flags were LDLIBS and not LDFLAGS, because we specify the libraries we want to link in, not flags to the linker itself. The order was broken as it didn't allow -Wl,--as-needed or other things highly dependent on the order of arguments. I also wanted to add an explicit .c.o suffix rule. This way, it is clearer what is happening in the Makefile and the form of compilation output is controllable. 64083809662501469ce77027b7a60001e88d39f4 2017-04-16T21:30:43Z 2017-04-16T21:30:43Z Add Alexander and Mattias to LICENSE Laslo Hunhold dev@frign.de commit 64083809662501469ce77027b7a60001e88d39f4 parent 80aabad7cb520fd890dfb82d35da30a9300ee439 Author: Laslo Hunhold <dev@frign.de> Date: Sun, 16 Apr 2017 23:30:43 +0200 Add Alexander and Mattias to LICENSE 80aabad7cb520fd890dfb82d35da30a9300ee439 2017-04-16T21:22:25Z 2017-04-16T21:24:43Z Bring cc-command-line in order Laslo Hunhold dev@frign.de commit 80aabad7cb520fd890dfb82d35da30a9300ee439 parent 00dd0ab39f634729ec5d99b8057b9cef6fa0f23e Author: Laslo Hunhold <dev@frign.de> Date: Sun, 16 Apr 2017 23:22:25 +0200 Bring cc-command-line in order Of course, you want the libraries to come last in order of execution. Additionally, in case the libraries provided with $($*-LDFLAGS) contain unresolved symbols, we want to give the opportunity for the user to provide the necessary general symbols, whatever they may be, last. Thanks Duncaen for reporting this! 00dd0ab39f634729ec5d99b8057b9cef6fa0f23e 2017-04-14T20:53:43Z 2017-04-14T20:53:43Z Bump version to 3 Laslo Hunhold dev@frign.de commit 00dd0ab39f634729ec5d99b8057b9cef6fa0f23e parent 62b95f7f7b3dc6e9fc6add9a186ff5b4b0ece535 Author: Laslo Hunhold <dev@frign.de> Date: Fri, 14 Apr 2017 22:53:43 +0200 Bump version to 3 This is more or less a refactoring release, but with deep changes in the tools that I was hoping to look into for a long time. The codebase is in a very consistent state now, also thanks to the introduction of a set of common utility-functions. What really makes me think is the fact that it takes so many iterations and a high level of detail to get the library handling and I/O right. It just makes you wonder how much software is out there that is full of little subtle bugs that might blow up in your face some day. Thanks for all the feedback! 62b95f7f7b3dc6e9fc6add9a186ff5b4b0ece535 2017-04-14T20:39:15Z 2017-04-14T20:39:15Z Improve the wording on alpha-blending Laslo Hunhold dev@frign.de commit 62b95f7f7b3dc6e9fc6add9a186ff5b4b0ece535 parent 4aa840bd871694cca0ae1608eab1086eef7d228b Author: Laslo Hunhold <dev@frign.de> Date: Fri, 14 Apr 2017 22:39:15 +0200 Improve the wording on alpha-blending 4aa840bd871694cca0ae1608eab1086eef7d228b 2017-04-14T20:26:03Z 2017-04-14T20:26:03Z Remove the need of '#' for alpha masks Laslo Hunhold dev@frign.de commit 4aa840bd871694cca0ae1608eab1086eef7d228b parent a5a5706f16408ce181775d319b264d03e67819f3 Author: Laslo Hunhold <dev@frign.de> Date: Fri, 14 Apr 2017 22:26:03 +0200 Remove the need of '#' for alpha masks To be honest, it can happen too easily that the user forgets to put the colour in quotation marks, yielding in the rest of the pipeline to be discarded as a comment. a5a5706f16408ce181775d319b264d03e67819f3 2017-04-14T20:15:25Z 2017-04-14T20:15:25Z Improve readability of alpha-blending sections Laslo Hunhold dev@frign.de commit a5a5706f16408ce181775d319b264d03e67819f3 parent 6afe09e729e3428a5317c57c8315897f7110bffa Author: Laslo Hunhold <dev@frign.de> Date: Fri, 14 Apr 2017 22:15:25 +0200 Improve readability of alpha-blending sections 6afe09e729e3428a5317c57c8315897f7110bffa 2017-04-14T19:54:27Z 2017-04-14T19:54:27Z Move the logo a bit to the left so it is centered Laslo Hunhold dev@frign.de commit 6afe09e729e3428a5317c57c8315897f7110bffa parent c73b142d053818cdafddf5c66cfc2a4f90de7aa1 Author: Laslo Hunhold <dev@frign.de> Date: Fri, 14 Apr 2017 21:54:27 +0200 Move the logo a bit to the left so it is centered c73b142d053818cdafddf5c66cfc2a4f90de7aa1 2017-04-14T19:52:42Z 2017-04-14T19:52:42Z Fix the R in the logo Laslo Hunhold dev@frign.de commit c73b142d053818cdafddf5c66cfc2a4f90de7aa1 parent f04abc0e2f995e95fda64230a2bd4c289b10d6bf Author: Laslo Hunhold <dev@frign.de> Date: Fri, 14 Apr 2017 21:52:42 +0200 Fix the R in the logo f04abc0e2f995e95fda64230a2bd4c289b10d6bf 2017-04-14T19:45:32Z 2017-04-14T19:45:32Z Update usage of ff2jpg(1) and ff2ppm(1) Laslo Hunhold dev@frign.de commit f04abc0e2f995e95fda64230a2bd4c289b10d6bf parent 9fdfff98f15fb3f7a01d944aba5d75d9d34c66ed Author: Laslo Hunhold <dev@frign.de> Date: Fri, 14 Apr 2017 21:45:32 +0200 Update usage of ff2jpg(1) and ff2ppm(1) so they align with the manpages. 9fdfff98f15fb3f7a01d944aba5d75d9d34c66ed 2017-04-14T19:40:20Z 2017-04-14T19:42:43Z Refactor invert.c in farbfeld.5 Laslo Hunhold dev@frign.de commit 9fdfff98f15fb3f7a01d944aba5d75d9d34c66ed parent 781cec031d8ebc40b36cf06e7c3bf1080745e1d2 Author: Laslo Hunhold <dev@frign.de> Date: Fri, 14 Apr 2017 21:40:20 +0200 Refactor invert.c in farbfeld.5 I noticed that it would be beneficial to release the invert.c code listing under a very permissive license. I like the style of the "Copy me if you can"-License, but thought that 0BSD would make it even clearer that everyone can do whatever he wants with this code. The code itself was not bad beforehand, but lacked some elementary features like checked flushing at the end and proper error messages. I also reworked the data structures a bit to make it more appealing and clearer where the "guts" of the code are (i.e. in invert()). 781cec031d8ebc40b36cf06e7c3bf1080745e1d2 2017-04-14T18:10:27Z 2017-04-14T18:10:27Z Update the Makefile to reflect TODO has been removed Laslo Hunhold dev@frign.de commit 781cec031d8ebc40b36cf06e7c3bf1080745e1d2 parent 48bd9e1f4c7c4c45957575f68b1ee0cdeba42fd3 Author: Laslo Hunhold <dev@frign.de> Date: Fri, 14 Apr 2017 20:10:27 +0200 Update the Makefile to reflect TODO has been removed 48bd9e1f4c7c4c45957575f68b1ee0cdeba42fd3 2017-04-14T18:04:40Z 2017-04-14T18:04:40Z Update and refactor the manpages Laslo Hunhold dev@frign.de commit 48bd9e1f4c7c4c45957575f68b1ee0cdeba42fd3 parent 3d73fbaa1aeab1000d7f77cd6ee21f06a9b02e04 Author: Laslo Hunhold <dev@frign.de> Date: Fri, 14 Apr 2017 20:04:40 +0200 Update and refactor the manpages Make them more consistent, and only maintain a list of the conversion tools in farbfeld.5. Refine the wording on the jpg-manpages. 3d73fbaa1aeab1000d7f77cd6ee21f06a9b02e04 2017-04-14T16:21:22Z 2017-04-14T16:21:22Z Update the README Laslo Hunhold dev@frign.de commit 3d73fbaa1aeab1000d7f77cd6ee21f06a9b02e04 parent 96d6bde7d9bb6a79b7f86fbbc285a49b9634cd63 Author: Laslo Hunhold <dev@frign.de> Date: Fri, 14 Apr 2017 18:21:22 +0200 Update the README Rework the introductory paragraph and show examples directly afterwards. If people are interested in the tl;dr-sections, they can then read on. 96d6bde7d9bb6a79b7f86fbbc285a49b9634cd63 2017-04-14T15:51:40Z 2017-04-14T15:51:40Z Don't suppress imagemagick and png2ff(1) warnings Laslo Hunhold dev@frign.de commit 96d6bde7d9bb6a79b7f86fbbc285a49b9634cd63 parent 1f9d0c28423ae3e422327a8ee5422aac23391231 Author: Laslo Hunhold <dev@frign.de> Date: Fri, 14 Apr 2017 17:51:40 +0200 Don't suppress imagemagick and png2ff(1) warnings Else the user might be left wondering what happened. The output from imagemagick might not be the nicest in the world, but it's bearable for some given edge-cases. 1f9d0c28423ae3e422327a8ee5422aac23391231 2017-04-14T15:39:25Z 2017-04-14T15:39:25Z Make comment in ff2jpg(1) more consistent Laslo Hunhold dev@frign.de commit 1f9d0c28423ae3e422327a8ee5422aac23391231 parent 42678350147b13345174f1e4c637a89c442ffd3c Author: Laslo Hunhold <dev@frign.de> Date: Fri, 14 Apr 2017 17:39:25 +0200 Make comment in ff2jpg(1) more consistent 42678350147b13345174f1e4c637a89c442ffd3c 2017-04-14T15:32:12Z 2017-04-14T15:36:49Z Refactor 2ff(1) Laslo Hunhold dev@frign.de commit 42678350147b13345174f1e4c637a89c442ffd3c parent 65435b097b355105dc9a32f87ed80427d56b1c91 Author: Laslo Hunhold <dev@frign.de> Date: Fri, 14 Apr 2017 17:32:12 +0200 Refactor 2ff(1) The Unix philosophy teaches us that tools should strive to output only necessary diagnostic information and also reflect errors properly with the return value. There were three subtle problems with 2ff: 1) If the farbfeld-passthrough failed, it would return 1 instead of 1. 2) If the first 8 bytes contained a NUL byte, bash would print an ugly warning message. Passing it through tr -d '\0' fixes that. 3) Lack of comments. I added some to make the structure even clearer, also including using an if-else-structure. I removed the 2ff error message; the tools themselves print proper messages already. 65435b097b355105dc9a32f87ed80427d56b1c91 2017-04-14T14:39:05Z 2017-04-14T14:39:05Z Staticize functions in png2ff(1) Laslo Hunhold dev@frign.de commit 65435b097b355105dc9a32f87ed80427d56b1c91 parent 1510ddefc12775143fd05286e92c38d4aed7c3a9 Author: Laslo Hunhold <dev@frign.de> Date: Fri, 14 Apr 2017 16:39:05 +0200 Staticize functions in png2ff(1) 1510ddefc12775143fd05286e92c38d4aed7c3a9 2017-04-14T14:21:06Z 2017-04-14T14:21:06Z Remove TODO Laslo Hunhold dev@frign.de commit 1510ddefc12775143fd05286e92c38d4aed7c3a9 parent 3a701d548362812f9c9b21e960c7abe50989a33e Author: Laslo Hunhold <dev@frign.de> Date: Fri, 14 Apr 2017 16:21:06 +0200 Remove TODO It's not very useful for the reader any more. 3a701d548362812f9c9b21e960c7abe50989a33e 2017-04-14T14:04:14Z 2017-04-14T14:04:14Z Add PNG-LDFLAGS and JPG-LDFLAGS in config.mk Laslo Hunhold dev@frign.de commit 3a701d548362812f9c9b21e960c7abe50989a33e parent 17f09e2cea4dda0f54841f7a273e347b53f4996e Author: Laslo Hunhold <dev@frign.de> Date: Fri, 14 Apr 2017 16:04:14 +0200 Add PNG-LDFLAGS and JPG-LDFLAGS in config.mk instead of per-tool-settings. 17f09e2cea4dda0f54841f7a273e347b53f4996e 2017-04-12T22:07:10Z 2017-04-12T22:07:10Z Use fshut() to properly flush the output stream Laslo Hunhold dev@frign.de commit 17f09e2cea4dda0f54841f7a273e347b53f4996e parent bc03439e0e0c439bb9c6c3167d9c272f3b7d5632 Author: Laslo Hunhold <dev@frign.de> Date: Thu, 13 Apr 2017 00:07:10 +0200 Use fshut() to properly flush the output stream For small images, it could happen that the output stream would not be flushed before exit(), resulting in a lack of error-reporting on a full device. Using fflush(), a function I first introduced in sbase, we do the flushing before returning manually and report errors if they occurred. bc03439e0e0c439bb9c6c3167d9c272f3b7d5632 2017-04-12T21:48:28Z 2017-04-12T21:48:28Z Update LICENSE Laslo Hunhold dev@frign.de commit bc03439e0e0c439bb9c6c3167d9c272f3b7d5632 parent 2eef6816e870074494465346ca2879959faec9da Author: Laslo Hunhold <dev@frign.de> Date: Wed, 12 Apr 2017 23:48:28 +0200 Update LICENSE 2eef6816e870074494465346ca2879959faec9da 2017-04-12T21:43:31Z 2017-04-12T21:43:31Z Update TODO Laslo Hunhold dev@frign.de commit 2eef6816e870074494465346ca2879959faec9da parent 7a11656e9649247179bdae941683b4ac78e22586 Author: Laslo Hunhold <dev@frign.de> Date: Wed, 12 Apr 2017 23:43:31 +0200 Update TODO The truncation issue is solved now by checking the return values. Maybe for small images where the FILE-buffer is not flushed early enough we can rethink that. The utility functions were written to the extent it was desired. I added a note not to forget to take a look at the part in the jpg-code which does the color mixing. 7a11656e9649247179bdae941683b4ac78e22586 2017-04-12T21:42:19Z 2017-04-12T21:42:19Z Refactor ff2ppm(1) Laslo Hunhold dev@frign.de commit 7a11656e9649247179bdae941683b4ac78e22586 parent da99b58226c8dbb0cf764bbc7b42b7e3a36ff292 Author: Laslo Hunhold <dev@frign.de> Date: Wed, 12 Apr 2017 23:42:19 +0200 Refactor ff2ppm(1) We make use of the utility functions for parsing the color mask and other things and generally align the code with the general coding style. da99b58226c8dbb0cf764bbc7b42b7e3a36ff292 2017-04-12T21:41:00Z 2017-04-12T21:41:00Z Refactor png-conversion-utilities Laslo Hunhold dev@frign.de commit da99b58226c8dbb0cf764bbc7b42b7e3a36ff292 parent a78b5dc6efaca25830c31ac17ef3ff81a493314d Author: Laslo Hunhold <dev@frign.de> Date: Wed, 12 Apr 2017 23:41:00 +0200 Refactor png-conversion-utilities We split out the libpng-setup into a separate function, it is very very ugly. The code also received a general cleanup and aligns itself much better with the general coding style and structure. a78b5dc6efaca25830c31ac17ef3ff81a493314d 2017-04-12T21:39:41Z 2017-04-12T21:39:41Z Refactor ff2pam(1) Laslo Hunhold dev@frign.de commit a78b5dc6efaca25830c31ac17ef3ff81a493314d parent 9a992f810d2a11751026ac352f435be1717e0979 Author: Laslo Hunhold <dev@frign.de> Date: Wed, 12 Apr 2017 23:39:41 +0200 Refactor ff2pam(1) I chose to go with a row-based-approach here, which is a bit easier to read and is somewhat "closer" to the input data. 9a992f810d2a11751026ac352f435be1717e0979 2017-04-12T21:36:47Z 2017-04-12T21:36:47Z Refactor jpg-conversion-utilities Laslo Hunhold dev@frign.de commit 9a992f810d2a11751026ac352f435be1717e0979 parent f22282e99a963f5935ea68a583cc7d928a787ce1 Author: Laslo Hunhold <dev@frign.de> Date: Wed, 12 Apr 2017 23:36:47 +0200 Refactor jpg-conversion-utilities First of all, there was lots of libjpeg-specific cruft that just didn't have any right to exist (METHODDEF(), strange typedefs, use of the internal memory pool for no reason). This is gone now. Additionally, we make use of the save and proven utility functions and in general the code should be more well-separated now. What is left to do is clear up the part where we mix the colors with the mask. f22282e99a963f5935ea68a583cc7d928a787ce1 2017-04-12T21:36:06Z 2017-04-12T21:36:06Z Also print extra warnings Laslo Hunhold dev@frign.de commit f22282e99a963f5935ea68a583cc7d928a787ce1 parent aa873108425a500d8f47edb56fb476f248cb09d0 Author: Laslo Hunhold <dev@frign.de> Date: Wed, 12 Apr 2017 23:36:06 +0200 Also print extra warnings aa873108425a500d8f47edb56fb476f248cb09d0 2017-04-12T21:34:40Z 2017-04-12T21:34:40Z Rename header-functions and add more util functions Laslo Hunhold dev@frign.de commit aa873108425a500d8f47edb56fb476f248cb09d0 parent 4ee1dee12fc4680504cb0a75c4b8a6862fd38db2 Author: Laslo Hunhold <dev@frign.de> Date: Wed, 12 Apr 2017 23:34:40 +0200 Rename header-functions and add more util functions parse_mask() -> parse a mask-color #xxxxxx ereallocarray() estrtonum() These will come in handy in the respective tools. 4ee1dee12fc4680504cb0a75c4b8a6862fd38db2 2017-04-02T18:56:15Z 2017-04-02T18:56:15Z config.mk: C89 -> C99 Laslo Hunhold dev@frign.de commit 4ee1dee12fc4680504cb0a75c4b8a6862fd38db2 parent cef01ad97b1e215b0879c369e42e31bb3e5188a1 Author: Laslo Hunhold <dev@frign.de> Date: Sun, 2 Apr 2017 20:56:15 +0200 config.mk: C89 -> C99 We are using stdint.h, which is a C99 feature. Syntactically, the code is C89 though. cef01ad97b1e215b0879c369e42e31bb3e5188a1 2017-04-02T18:53:55Z 2017-04-02T18:55:49Z Remove prerequisite from single-suffix inference rule Laslo Hunhold dev@frign.de commit cef01ad97b1e215b0879c369e42e31bb3e5188a1 parent d25f3c73afa5beb83121c9b033bc0146c755ca3a Author: Laslo Hunhold <dev@frign.de> Date: Sun, 2 Apr 2017 20:53:55 +0200 Remove prerequisite from single-suffix inference rule This is against the standard: "The application shall ensure that the makefile does not specify prerequisites for inference rules;"[0] We are still fine though as we explicitly state the dependency on the requisite-objects in the $(BIN)-target. Thanks Lucas for pointing this out! [0]:http://pubs.opengroup.org/onlinepubs/9699919799/utilities/make.html d25f3c73afa5beb83121c9b033bc0146c755ca3a 2017-03-30T07:49:48Z 2017-03-30T07:49:48Z Add util.{c|h} to deduplicate code Laslo Hunhold dev@frign.de commit d25f3c73afa5beb83121c9b033bc0146c755ca3a parent d0ce307972fbc95073666e92043fc7012ffbefdf Author: Laslo Hunhold <dev@frign.de> Date: Thu, 30 Mar 2017 09:49:48 +0200 Add util.{c|h} to deduplicate code d0ce307972fbc95073666e92043fc7012ffbefdf 2017-03-30T07:29:06Z 2017-03-30T07:29:06Z Mark explicit dependency on requisites for BIN Laslo Hunhold dev@frign.de commit d0ce307972fbc95073666e92043fc7012ffbefdf parent 0aaa36464a4ad965a3d747cc6df16137c7b5d6c5 Author: Laslo Hunhold <dev@frign.de> Date: Thu, 30 Mar 2017 09:29:06 +0200 Mark explicit dependency on requisites for BIN 0aaa36464a4ad965a3d747cc6df16137c7b5d6c5 2017-03-30T06:59:52Z 2017-03-30T06:59:52Z Pass LDFLAGS instead of CFLAGS in the linking stage Laslo Hunhold dev@frign.de commit 0aaa36464a4ad965a3d747cc6df16137c7b5d6c5 parent ef433a6baa3449f5a5ec7a6fd09efdd0ea6fb57b Author: Laslo Hunhold <dev@frign.de> Date: Thu, 30 Mar 2017 08:59:52 +0200 Pass LDFLAGS instead of CFLAGS in the linking stage ef433a6baa3449f5a5ec7a6fd09efdd0ea6fb57b 2017-03-30T06:52:22Z 2017-03-30T06:52:22Z No need to keep the implicit build rule Laslo Hunhold dev@frign.de commit ef433a6baa3449f5a5ec7a6fd09efdd0ea6fb57b parent bbe28227eb80da62fec59aa79ba7a97f5c3937b4 Author: Laslo Hunhold <dev@frign.de> Date: Thu, 30 Mar 2017 08:52:22 +0200 No need to keep the implicit build rule bbe28227eb80da62fec59aa79ba7a97f5c3937b4 2017-03-30T06:41:17Z 2017-03-30T06:43:42Z Make Makefile strictly POSIX compliant Laslo Hunhold dev@frign.de commit bbe28227eb80da62fec59aa79ba7a97f5c3937b4 parent 65829635d9f5f9f4a23c2f890c60c315bcbafee2 Author: Laslo Hunhold <dev@frign.de> Date: Thu, 30 Mar 2017 08:41:17 +0200 Make Makefile strictly POSIX compliant Thanks Hiltjo for the feedback! GNUisms need to be avoided like a plague, even if it means having to be a little more creative. Strict POSIX compliance means that I just worked within the bounds of the POSIX specification, hopefully without using any GNU or BSD extensions. If I did, please let me know. Tip to all Linux users: Test your Makefiles with pmake(1) instead of make(1) (= GNU make) and refer to the newest POSIX 2016 make specification[0]. [0]: http://pubs.opengroup.org/onlinepubs/9699919799/utilities/make.html 65829635d9f5f9f4a23c2f890c60c315bcbafee2 2017-03-29T16:07:29Z 2017-03-29T16:07:29Z Rename PREREQ to REQ Laslo Hunhold dev@frign.de commit 65829635d9f5f9f4a23c2f890c60c315bcbafee2 parent 416f39e3d68a6b12a05751930a609cfbbde483ff Author: Laslo Hunhold <dev@frign.de> Date: Wed, 29 Mar 2017 18:07:29 +0200 Rename PREREQ to REQ 416f39e3d68a6b12a05751930a609cfbbde483ff 2017-03-29T15:51:41Z 2017-03-29T15:51:41Z Overhaul Build-system Laslo Hunhold dev@frign.de commit 416f39e3d68a6b12a05751930a609cfbbde483ff parent 2ae075c04cff633eddefd3c07363d60bd05a3129 Author: Laslo Hunhold <dev@frign.de> Date: Wed, 29 Mar 2017 17:51:41 +0200 Overhaul Build-system I didn't like the current Makefiles. They were too crufted and not elegant. Additionally, given I'm planning to put some utility functions into a util.{c|h}-prerequisite, I wrote this new Makefile with PREREQs in mind. 2ae075c04cff633eddefd3c07363d60bd05a3129 2017-01-09T18:43:46Z 2017-01-09T18:43:46Z Update TODO Laslo Hunhold dev@frign.de commit 2ae075c04cff633eddefd3c07363d60bd05a3129 parent 3d80d7237d18bdbf53e327a576b52b35b36af3ad Author: Laslo Hunhold <dev@frign.de> Date: Mon, 9 Jan 2017 19:43:46 +0100 Update TODO 3d80d7237d18bdbf53e327a576b52b35b36af3ad 2017-01-09T04:23:27Z 2017-01-09T18:42:39Z Add ff2pam(1): convert farbfeld to 16-bit RGBA Portable Arbitrary Map Mattias Andrée maandree@kth.se commit 3d80d7237d18bdbf53e327a576b52b35b36af3ad parent e9db1f49b75b183c8aeda321ca54aff5b436a4f6 Author: Mattias Andrée <maandree@kth.se> Date: Mon, 9 Jan 2017 05:23:27 +0100 Add ff2pam(1): convert farbfeld to 16-bit RGBA Portable Arbitrary Map Laslo: Minor changes Signed-off-by: Mattias Andrée <maandree@kth.se> e9db1f49b75b183c8aeda321ca54aff5b436a4f6 2016-09-19T20:51:45Z 2016-09-19T20:51:45Z 2ff: use trap to remove temporary file FRIGN dev@frign.de commit e9db1f49b75b183c8aeda321ca54aff5b436a4f6 parent 48c52a1f4889858ae3466f1987b522e426b6ddf3 Author: FRIGN <dev@frign.de> Date: Mon, 19 Sep 2016 22:51:45 +0200 2ff: use trap to remove temporary file This also frees us from having to store the return value somewhere. 48c52a1f4889858ae3466f1987b522e426b6ddf3 2016-09-19T19:47:50Z 2016-09-19T19:47:50Z 2ff: make it more portable FRIGN dev@frign.de commit 48c52a1f4889858ae3466f1987b522e426b6ddf3 parent 728997ff9662e6790165fd76296bef9ff8a09d93 Author: FRIGN <dev@frign.de> Date: Mon, 19 Sep 2016 21:47:50 +0200 2ff: make it more portable Thanks Roberto and Evan Gates! 728997ff9662e6790165fd76296bef9ff8a09d93 2016-09-19T17:07:27Z 2016-09-19T17:07:27Z 2ff: Make it idempotent and clean it up a bit FRIGN dev@frign.de commit 728997ff9662e6790165fd76296bef9ff8a09d93 parent 1f8903d1689e5f796fbe227587081d28f864cb07 Author: FRIGN <dev@frign.de> Date: Mon, 19 Sep 2016 19:07:27 +0200 2ff: Make it idempotent and clean it up a bit If a file begins with "farbfeld", we just pass it through. 1f8903d1689e5f796fbe227587081d28f864cb07 2016-09-07T21:10:05Z 2016-09-07T21:10:05Z Shellcheck 2ff fixes FRIGN dev@frign.de commit 1f8903d1689e5f796fbe227587081d28f864cb07 parent 3fa775e1dfd5dc38648f88c2f385be1f0fe45605 Author: FRIGN <dev@frign.de> Date: Wed, 7 Sep 2016 23:10:05 +0200 Shellcheck 2ff fixes I was inspired by the current discussion on dev@ to use shellcheck to check my scripts and thought it might be a good choice to do this for the 2ff script. Not much had to be changed, because I was careful writing it, but still it won't hurt to but $TMP in double quotes. 3fa775e1dfd5dc38648f88c2f385be1f0fe45605 2016-05-18T22:21:58Z 2016-05-19T10:55:45Z Improve fread error handling in ff2* Alexander Krotov ilabdsf@yandex.ru commit 3fa775e1dfd5dc38648f88c2f385be1f0fe45605 parent c494437937ee01c6d3eb5b630a15e207aae76c25 Author: Alexander Krotov <ilabdsf@yandex.ru> Date: Thu, 19 May 2016 01:21:58 +0300 Improve fread error handling in ff2* In case of unexpected end of file errno is not set, and strerror(errno) returns "Success". Caller should distinguish between error and EOF by calling ferror(3) as described in fread(3). c494437937ee01c6d3eb5b630a15e207aae76c25 2016-05-17T21:02:25Z 2016-05-18T08:34:05Z Makefile improvements Hiltjo Posthuma hiltjo@codemadness.org commit c494437937ee01c6d3eb5b630a15e207aae76c25 parent 3d0f4c70385c8ad1dbaad1bb266e644c7109aa6a Author: Hiltjo Posthuma <hiltjo@codemadness.org> Date: Tue, 17 May 2016 23:02:25 +0200 Makefile improvements - fix: rebuild on source change. - allow to override dependency flag per tool (the ones that have deps). - rebuild on config.mk or headers change. 3d0f4c70385c8ad1dbaad1bb266e644c7109aa6a 2016-05-18T08:33:41Z 2016-05-18T08:33:41Z Revert "Fix Makefile to rebuild when there have been changes" FRIGN dev@frign.de commit 3d0f4c70385c8ad1dbaad1bb266e644c7109aa6a parent 545c500d4278c50e781c9a5a550e92cb0023c8e8 Author: FRIGN <dev@frign.de> Date: Wed, 18 May 2016 10:33:41 +0200 Revert "Fix Makefile to rebuild when there have been changes" This reverts commit 545c500d4278c50e781c9a5a550e92cb0023c8e8. 545c500d4278c50e781c9a5a550e92cb0023c8e8 2016-05-17T19:53:38Z 2016-05-17T19:53:38Z Fix Makefile to rebuild when there have been changes FRIGN dev@frign.de commit 545c500d4278c50e781c9a5a550e92cb0023c8e8 parent 96faf20b1bcef354e6b1fd03a26c286070c52e74 Author: FRIGN <dev@frign.de> Date: Tue, 17 May 2016 21:53:38 +0200 Fix Makefile to rebuild when there have been changes I forgot to add the dependencies in the build process 96faf20b1bcef354e6b1fd03a26c286070c52e74 2016-04-10T20:54:42Z 2016-04-10T20:54:42Z Remove dimension checks FRIGN dev@frign.de commit 96faf20b1bcef354e6b1fd03a26c286070c52e74 parent d8796e33f347b92a6526a1f3e6da8f5ddae7391b Author: FRIGN <dev@frign.de> Date: Sun, 10 Apr 2016 22:54:42 +0200 Remove dimension checks This may come as a surprise, but I'd like the libraries to handle these cases. Maybe some day libpng supports 0x0 images, so why impose artificial limits here? Same with ppm. For me, an ideal data converter loses as little information as possible. In mixed cases (dimensions 0xn, where n > 0) we could print a warning, but here, 2 principles come at play: - GIGO (garbage in, garbage out) - no information loss if possible Given the code later on won't try to access the malloc(0) region, we are also all safe. d8796e33f347b92a6526a1f3e6da8f5ddae7391b 2016-04-03T20:17:33Z 2016-04-03T20:17:33Z Remove line-breaks from Makefile FRIGN dev@frign.de commit d8796e33f347b92a6526a1f3e6da8f5ddae7391b parent 47a5f38ce9d44b5c3c0dad9e7824c8e2156a203d Author: FRIGN <dev@frign.de> Date: Sun, 3 Apr 2016 22:17:33 +0200 Remove line-breaks from Makefile Even though I like line-length limits, it imposed a useless limitation on the console output, given the line input is variable. 47a5f38ce9d44b5c3c0dad9e7824c8e2156a203d 2016-04-03T19:44:20Z 2016-04-03T20:07:12Z Makefile improvements Hiltjo Posthuma hiltjo@codemadness.org commit 47a5f38ce9d44b5c3c0dad9e7824c8e2156a203d parent 34e9cba51f5149da0670b32101e23b4d76e20d61 Author: Hiltjo Posthuma <hiltjo@codemadness.org> Date: Sun, 3 Apr 2016 21:44:20 +0200 Makefile improvements - be verbose by default: don't hide the executed commands. - no need to make clean on make dist, but make sure to have a clean directory. - define 2ff in ${SCRIPTS}. - make dist: gzip directly, don't store intermediate step (faster for make dist on floppies). - don't cd into directories, just loop each file. 34e9cba51f5149da0670b32101e23b4d76e20d61 2016-03-24T18:17:48Z 2016-04-03T18:39:13Z add ff2jpg tool, convert farbfeld images to RGB JPEG Hiltjo Posthuma hiltjo@codemadness.org commit 34e9cba51f5149da0670b32101e23b4d76e20d61 parent 7f295f8c100a504c305d537bd3fde6492f15ef7a Author: Hiltjo Posthuma <hiltjo@codemadness.org> Date: Thu, 24 Mar 2016 19:17:48 +0100 add ff2jpg tool, convert farbfeld images to RGB JPEG 7f295f8c100a504c305d537bd3fde6492f15ef7a 2016-03-24T18:09:41Z 2016-04-03T18:39:13Z don't link against unneeded libs Hiltjo Posthuma hiltjo@codemadness.org commit 7f295f8c100a504c305d537bd3fde6492f15ef7a parent 264979bf52261cb461212be8978c2a4697aa2e80 Author: Hiltjo Posthuma <hiltjo@codemadness.org> Date: Thu, 24 Mar 2016 19:09:41 +0100 don't link against unneeded libs - jpg2ff requires libjpeg - ff2png, png2ff requires libpng (and libz) - ff2ppm has no dependencies 264979bf52261cb461212be8978c2a4697aa2e80 2016-03-24T17:45:57Z 2016-04-03T18:39:13Z fix bugs introduced by refactor f0a4ce113d0e9dc50110a0ad9e98433d05aa2307 Hiltjo Posthuma hiltjo@codemadness.org commit 264979bf52261cb461212be8978c2a4697aa2e80 parent 265ded62c50b4d6be72fbff0a10304280ec233e5 Author: Hiltjo Posthuma <hiltjo@codemadness.org> Date: Thu, 24 Mar 2016 18:45:57 +0100 fix bugs introduced by refactor f0a4ce113d0e9dc50110a0ad9e98433d05aa2307 265ded62c50b4d6be72fbff0a10304280ec233e5 2016-03-21T22:41:27Z 2016-03-21T22:41:27Z Use uint8_t instead of uint16_t correctly FRIGN dev@frign.de commit 265ded62c50b4d6be72fbff0a10304280ec233e5 parent fdf5a2b53a7499e5860323255d914191aee7cdba Author: FRIGN <dev@frign.de> Date: Mon, 21 Mar 2016 23:41:27 +0100 Use uint8_t instead of uint16_t correctly fdf5a2b53a7499e5860323255d914191aee7cdba 2016-03-21T21:54:49Z 2016-03-21T21:54:49Z Write a better format for the row-buffer allocation FRIGN dev@frign.de commit fdf5a2b53a7499e5860323255d914191aee7cdba parent f0a4ce113d0e9dc50110a0ad9e98433d05aa2307 Author: FRIGN <dev@frign.de> Date: Mon, 21 Mar 2016 22:54:49 +0100 Write a better format for the row-buffer allocation f0a4ce113d0e9dc50110a0ad9e98433d05aa2307 2016-03-21T21:26:37Z 2016-03-21T21:26:37Z Optimize ff2ppm(1) FRIGN dev@frign.de commit f0a4ce113d0e9dc50110a0ad9e98433d05aa2307 parent 0da581eb1d2da5300d7b3e36ab6aa84b69ec2525 Author: FRIGN <dev@frign.de> Date: Mon, 21 Mar 2016 22:26:37 +0100 Optimize ff2ppm(1) use the proper multiplication factors :) 0da581eb1d2da5300d7b3e36ab6aa84b69ec2525 2016-03-21T20:09:14Z 2016-03-21T20:37:13Z add arg.h (needed for ff2ppm) Hiltjo Posthuma hiltjo@codemadness.org commit 0da581eb1d2da5300d7b3e36ab6aa84b69ec2525 parent dc512d040c7d081ed96b1919420aebd646968879 Author: Hiltjo Posthuma <hiltjo@codemadness.org> Date: Mon, 21 Mar 2016 21:09:14 +0100 add arg.h (needed for ff2ppm) dc512d040c7d081ed96b1919420aebd646968879 2016-03-21T20:06:06Z 2016-03-21T20:37:13Z add ff2ppm(1) Hiltjo Posthuma hiltjo@codemadness.org commit dc512d040c7d081ed96b1919420aebd646968879 parent e637aae67ededf6a4a0b4d490d02f3294f297b71 Author: Hiltjo Posthuma <hiltjo@codemadness.org> Date: Mon, 21 Mar 2016 21:06:06 +0100 add ff2ppm(1) ff2ppm can convert farbfeld images to PPM (P6 binary format, 24-bit RGB). ff2ppm has an option -b to set the background color, for example for png files: png2ff < test.png | ff2ppm -b '#00ff00' > test.ppm e637aae67ededf6a4a0b4d490d02f3294f297b71 2016-03-18T18:49:11Z 2016-03-18T18:49:11Z Prevent overflow in rowlen and improve inaccuracies in style FRIGN dev@frign.de commit e637aae67ededf6a4a0b4d490d02f3294f297b71 parent 49cef794d9cef3c1ab8478963a7f778c8c28eb70 Author: FRIGN <dev@frign.de> Date: Fri, 18 Mar 2016 19:49:11 +0100 Prevent overflow in rowlen and improve inaccuracies in style 49cef794d9cef3c1ab8478963a7f778c8c28eb70 2016-03-14T22:12:49Z 2016-03-14T22:12:49Z Bump version to 2 FRIGN dev@frign.de commit 49cef794d9cef3c1ab8478963a7f778c8c28eb70 parent 1d07cf4473ef4539d3ea249bf7e751a695470ff9 Author: FRIGN <dev@frign.de> Date: Mon, 14 Mar 2016 23:12:49 +0100 Bump version to 2 There have been quite considerable changes since version 1. The conversion tools have had a considerable performance boost of around 75% by using a row-buffer instead of reading each R-G-B-A-chunk individually. Also, 2ff(1) somehow called "xconvert" instead of "convert", rendering it useless for anything other than png's and jpg's. There was a small excursion to color spaces and ICC color profile handling, but this has been dismissed (it was a difficult decision). Thanks for all the feedback! 1d07cf4473ef4539d3ea249bf7e751a695470ff9 2016-03-04T11:31:58Z 2016-03-04T11:31:58Z Add proper blank lines in png2ff(1) before comments FRIGN dev@frign.de commit 1d07cf4473ef4539d3ea249bf7e751a695470ff9 parent 4d567caa917deab542225fd548a2673dea42461c Author: FRIGN <dev@frign.de> Date: Fri, 4 Mar 2016 12:31:58 +0100 Add proper blank lines in png2ff(1) before comments 4d567caa917deab542225fd548a2673dea42461c 2016-03-04T11:29:29Z 2016-03-04T11:30:49Z Fix 2 little things in jpg2ff(1) FRIGN dev@frign.de commit 4d567caa917deab542225fd548a2673dea42461c parent 3122c071397b4db9c9122072c56bd31c02085ca7 Author: FRIGN <dev@frign.de> Date: Fri, 4 Mar 2016 12:29:29 +0100 Fix 2 little things in jpg2ff(1) - actually print usage when one argument is given (forgot to incorporate the argv0-change there). - use fputs instead of fprintf for printing a string constant. 3122c071397b4db9c9122072c56bd31c02085ca7 2016-03-04T11:23:04Z 2016-03-04T11:23:04Z Use uint32-array to store the header FRIGN dev@frign.de commit 3122c071397b4db9c9122072c56bd31c02085ca7 parent 14df2f24dfedf9d12dcec02d57c596a34be0f197 Author: FRIGN <dev@frign.de> Date: Fri, 4 Mar 2016 12:23:04 +0100 Use uint32-array to store the header this goes around the undefined behaviour imposed by using (*(uint32_t *)(hdr + 4n)) 14df2f24dfedf9d12dcec02d57c596a34be0f197 2016-03-04T11:22:07Z 2016-03-04T11:22:07Z Fix 2ff FRIGN dev@frign.de commit 14df2f24dfedf9d12dcec02d57c596a34be0f197 parent 489b6402af4972b19a9295ccb74482b8daec83ec Author: FRIGN <dev@frign.de> Date: Fri, 4 Mar 2016 12:22:07 +0100 Fix 2ff No idea how "xconvert" sneaked into there. 489b6402af4972b19a9295ccb74482b8daec83ec 2016-02-22T16:40:07Z 2016-02-22T16:40:07Z Remove last ICC traces FRIGN dev@frign.de commit 489b6402af4972b19a9295ccb74482b8daec83ec parent cb90a3d930f63c1d5f9aca8c6b680735711303cf Author: FRIGN <dev@frign.de> Date: Mon, 22 Feb 2016 17:40:07 +0100 Remove last ICC traces cb90a3d930f63c1d5f9aca8c6b680735711303cf 2016-02-22T16:37:56Z 2016-02-22T16:38:27Z Use the "row-major" term instead of "row-aligned" FRIGN dev@frign.de commit cb90a3d930f63c1d5f9aca8c6b680735711303cf parent de61085a0413f2f7570a89df345eb875d1a0298c Author: FRIGN <dev@frign.de> Date: Mon, 22 Feb 2016 17:37:56 +0100 Use the "row-major" term instead of "row-aligned" de61085a0413f2f7570a89df345eb875d1a0298c 2016-02-01T12:36:55Z 2016-02-01T12:36:55Z Refactor tools and increase performance by ~70% FRIGN dev@frign.de commit de61085a0413f2f7570a89df345eb875d1a0298c parent 7b03f52a130a12355d87bc05f028db31963112cc Author: FRIGN <dev@frign.de> Date: Mon, 1 Feb 2016 13:36:55 +0100 Refactor tools and increase performance by ~70% Instead of calling fwrite on each channel, we write one big chunk of a line. This increases performance by around 70% compared to version 1 and the farbfeld tools are now roughly fast as imagemagick's convert. I also refactored the code, removed unnecessary variables and unified the variable naming and error reporting a bit. Inside jpg2ff, the loop didn't need 3 variables. 7b03f52a130a12355d87bc05f028db31963112cc 2016-01-30T23:08:17Z 2016-01-30T23:08:44Z Move alpha-premultiplication information away from the FORMAT FRIGN dev@frign.de commit 7b03f52a130a12355d87bc05f028db31963112cc parent dd22f4087d5e7420929575d1bbaf767d76395e9c Author: FRIGN <dev@frign.de> Date: Sun, 31 Jan 2016 00:08:17 +0100 Move alpha-premultiplication information away from the FORMAT and rather define it in the manual. In the end, it doesn't influence the data structure and thus is not part of the FORMAT-specification. dd22f4087d5e7420929575d1bbaf767d76395e9c 2016-01-29T22:34:24Z 2016-01-29T22:34:24Z Back to the roots. FRIGN dev@frign.de commit dd22f4087d5e7420929575d1bbaf767d76395e9c parent e9feca5c2bda05b9a356617868fd4b08ec903d0d Author: FRIGN <dev@frign.de> Date: Fri, 29 Jan 2016 23:34:24 +0100 Back to the roots. Talking with even more people and weighing the benefits, I've made the decision to remove color spaces from farbfeld again (as it currently is handled in version 1) and recommend sRGB, not force it. Thing is the following: We are not ready yet for this step. Neither the people working with the images nor the hardware to display extended colors. Using greater colorspaces also removes the "hackability" of farbfeld. As it was previously possible to easily create gradients in plain C, you have to keep multiple things in mind with linear ProPhoto RGB. The first thing is that not all colors are "real", and there are imaginary colors. This doesn't happen with sRGB because all the colors it describes are "real". The second thing is the linear gamma curve, which makes the gradients look perceptually inconsistent. In the interest of creating a good and simple interchange format, we can't only weigh in points of professionals. This little excursion has shown that aiming for the 99% is still the way to go. And as often as you could repeat that sRGB will meet its fate in the future when screens become better, it is surprising how badly the industry has caught up to it. I also must honestly say that we can't solve the color space issue using RGB and should look at other formats to explore (CIELUV, CIELAB), which I will probably give a talk about at slcon3. Before releasing version 2, my aim is to make the I/O a bit more effective (as far as possible) so it's even easier to use. I know people will be pissed off, but fuck it, I'm the maintainer! Live with it. e9feca5c2bda05b9a356617868fd4b08ec903d0d 2016-01-20T21:31:25Z 2016-01-20T21:31:25Z Use linear RGB FRIGN dev@frign.de commit e9feca5c2bda05b9a356617868fd4b08ec903d0d parent 291e677210c6c2c1d1eba2f0ba2243806ef63b07 Author: FRIGN <dev@frign.de> Date: Wed, 20 Jan 2016 22:31:25 +0100 Use linear RGB Makes things a lot easier for image manipulation algorithms which can be expected to be applied to farbfeld data. 291e677210c6c2c1d1eba2f0ba2243806ef63b07 2016-01-19T22:32:55Z 2016-01-19T22:32:55Z Update manpage reflecting the features of each tool FRIGN dev@frign.de commit 291e677210c6c2c1d1eba2f0ba2243806ef63b07 parent 2ea5274584f8f38a8bd49271ad7aebed5d3afec3 Author: FRIGN <dev@frign.de> Date: Tue, 19 Jan 2016 23:32:55 +0100 Update manpage reflecting the features of each tool 2ea5274584f8f38a8bd49271ad7aebed5d3afec3 2016-01-19T22:17:27Z 2016-01-19T22:17:27Z Remove more png cruft from code FRIGN dev@frign.de commit 2ea5274584f8f38a8bd49271ad7aebed5d3afec3 parent 93204899d4a27d2ecefe7fe7f0902f94cab72268 Author: FRIGN <dev@frign.de> Date: Tue, 19 Jan 2016 23:17:27 +0100 Remove more png cruft from code No need for these shitty png-types. 93204899d4a27d2ecefe7fe7f0902f94cab72268 2016-01-17T20:03:19Z 2016-01-17T20:03:19Z Add ICC-color-profile handling to jpg2ff FRIGN dev@frign.de commit 93204899d4a27d2ecefe7fe7f0902f94cab72268 parent 42ace91b3ddba2fa40e0362ce7aba814aa7dd79c Author: FRIGN <dev@frign.de> Date: Sun, 17 Jan 2016 21:03:19 +0100 Add ICC-color-profile handling to jpg2ff And fix a bug in the transforms that was introduced yesterday. The only thing remaining for jpg is handling EXIF-embedded color profiles, but the EXIF format sucks so bad. 42ace91b3ddba2fa40e0362ce7aba814aa7dd79c 2016-01-17T20:01:50Z 2016-01-17T20:01:50Z Fix gcc-optimization bug in png2ff FRIGN dev@frign.de commit 42ace91b3ddba2fa40e0362ce7aba814aa7dd79c parent 853b79b67c81735874acaeeab5293e9dd7af06bb Author: FRIGN <dev@frign.de> Date: Sun, 17 Jan 2016 21:01:50 +0100 Fix gcc-optimization bug in png2ff For some reason, those strange png_char_pp-passes were optimized away in some way, yielding in icc_len = 0. I now explicitly use the pointers to indicate to the compiler that we pass by reference. Fuck those png types... 853b79b67c81735874acaeeab5293e9dd7af06bb 2016-01-17T01:18:00Z 2016-01-17T01:18:00Z Clarify manpages in regard to the ICC handling FRIGN dev@frign.de commit 853b79b67c81735874acaeeab5293e9dd7af06bb parent 3bc6c69ae8ff25377848b76a25494aa4a0055544 Author: FRIGN <dev@frign.de> Date: Sun, 17 Jan 2016 02:18:00 +0100 Clarify manpages in regard to the ICC handling 3bc6c69ae8ff25377848b76a25494aa4a0055544 2016-01-17T00:39:36Z 2016-01-17T01:11:54Z Mandate "ProPhoto RGB" color space for farbfeld and handle ICC profiles FRIGN dev@frign.de commit 3bc6c69ae8ff25377848b76a25494aa4a0055544 parent a0767dd0ba8c9c5f04616ff5dc8d82b2591cf2d8 Author: FRIGN <dev@frign.de> Date: Sun, 17 Jan 2016 01:39:36 +0100 Mandate "ProPhoto RGB" color space for farbfeld and handle ICC profiles I've literally been thinking about this for quite a while now. The initial motivation behind defaulting to sRGB was the idea that most data on the web was in sRGB anyway. However, my assumption was weakened in the sense that the development is clearly moving towards images with supplied ICC profiles and software slowly catching up to handle this. My tests have shown that more and more people even do that on the web, even though it's been a "tradition" that Photoshop users "Save for Web" and convert the gamut lossy into sRGB to bring a consistent color-"experience" even to those clients not supporting ICC profiles and which always assume sRGB. What made this decision so difficult is that converting to "ProPhoto RGB" requires some advanced knowledge on this topic, however, I came to the conclusion to implement it given the *2ff- and ff2*-tools handle it silently and well in the background, and given the little cms library is actually quite okay to use. When converting from ff to png, a proper "Pro Photo RGB" ICC V4-profile is automatically included in the exported png by ff2png. V4 is not as widespread as V2, but in the worst case (no V4 support somewhere) the colors will just be a little off. As an added bonus, any input files for png2ff which include ICC profiles are also correctly handled and the color space conversions are executed as expected. Accordingly, the FORMAT-specification has been changed. While at it, I added the note on alpha-multiplication. Now the format is very exact and shouldn't leave any ambiguities. jpeg supports ICC profiles as well, but I hadn't had the chance to look into it (not as trivial as PNG probably, help appreciated :)), so I'm always assuming sRGB here. Rationale --------- It is not obvious why one would go through the lenghts of supporting this big-gamut colorspace and not just stick with sRGB. In 99% of the cases, there's no reason to do that, but with even more extreme developments in the OLED-sector and other advances display hardware is slowly getting more powerful than sRGB, asking for color information which is suitable for the task and actually uses the full potential. The decision in this regard was not difficult in farbfeld because we always use 16-Bit anyway and won't have to fear posterization in a big- gamut color-space.