• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

D bindings to the GraphicsMagick library.


Commit MetaInfo

Revisióncd39ae189cac7a49259f30d4ce0e11ddaf2f0b66 (tree)
Tiempo2023-07-04 11:04:26
AutorMio <stigma@disr...>
CommiterMio

Log Message

[examples] Update convert.d

See: https://codeberg.org/supercell/magickd/issues/6

Cambiar Resumen

Diferencia incremental

--- a/examples/convert.d
+++ b/examples/convert.d
@@ -21,26 +21,30 @@
2121 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2222 SOFTWARE.
2323 */
24+import std.path : extension;
2425 import std.stdio;
2526
2627 import magickd;
2728
2829 int main(string[] args) {
29- if (args.length != 3) {
30- stderr.writefln("Usage: %s <infile> <outfile>", args[0]);
31- return 1;
32- }
30+ if (args.length != 3) {
31+ stderr.writefln("Usage: %s <infile> <outfile>", args[0]);
32+ return 1;
33+ }
3334
34- initializeMagick();
35- scope(exit) destroyMagick();
35+ InitializeMagick(null);
36+ scope(exit) DestroyMagick();
3637
37- MagickWand wand = MagickWand.create();
38- wand.readImage(args[1]);
38+ MagickWand wand = MagickWand.create();
39+ wand.readImage(args[1]);
40+ if (null !is args[2].extension) {
41+ wand.setImageFormat(args[2].extension[1..$]);
42+ }
3943
40- // TODO: Try some methods.
44+ wand.blurImage(6, 3);
4145
42- // TODO: Implement wand.writeX
43- stderr.writefln("%s: Writing of images has not been implemented, so " ~
44- "this doesn't work correctly yet.", args[0]);
45- return 0;
46+ wand.writeImage(args[2]);
47+ writefln("Equivalent to:\n gm convert %s -blur 6x3 %s", args[1], args[2]);
48+
49+ return 0;
4650 }