WIP: JPG対応 #1

クローズ
suwakojpg から master への 4 コミットのマージを希望しています
オーナー
説明はありません。
suwako が 1 コミット追加 2023-10-24 12:27:27 +09:00
作成者
オーナー

memcpy()を使うのは安定じゃない

なお、JPGファイルをまだ開けられないらしい
gdbにより:

GNU gdb (GDB) 13.2
Copyright (C) 2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./mivfx...
(gdb) run ~/Eqjk_WgVQAE2psn-new.jpeg
Starting program: /home/suwako/dev/now/mivfx/mivfx ~/Eqjk_WgVQAE2psn-new.jpeg

This GDB supports auto-downloading debuginfo from the following URLs:
  <https://debuginfod.artixlinux.org>
Enable debuginfod for this session? (y or [n]) y
Debuginfod has been enabled.
To make this setting permanent, add 'set debuginfod enabled on' to .gdbinit.
Downloading separate debug info for system-supplied DSO at 0x7ffff7fc8000
Downloading separate debug info for /usr/lib/libX11.so.6
Downloading separate debug info for /usr/lib/libpng16.so.16
Downloading separate debug info for /usr/lib/libjpeg.so.8
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
Downloading separate debug info for /usr/lib/libxcb.so.1
Downloading separate debug info for /usr/lib/libXau.so.6
Downloading separate debug info for /usr/lib/libXdmcp.so.6
JPGのXImageを創作に失敗しました。
画像を開けられません: /home/suwako/Eqjk_WgVQAE2psn-new.jpeg
[Inferior 1 (process 8725) exited with code 01]
(gdb) break format/jpg.c:54
Breakpoint 1 at 0x555555557303: file format/jpg.c, line 54.
(gdb) run ~/Eqjk_WgVQAE2psn-new.jpeg
Starting program: /home/suwako/dev/now/mivfx/mivfx ~/Eqjk_WgVQAE2psn-new.jpeg
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".

Breakpoint 1, read_jpg (d=0x55555555b330, filename=0x7fffffffe376 "/home/suwako/Eqjk_WgVQAE2psn-new.jpeg") at format/jpg.c:54
54	  Visual *visual = DefaultVisual(d, DefaultScreen(d));
(gdb) next
55	  int bitmap_order = (ImageByteOrder(d) == LSBFirst) ? LSBFirst : MSBFirst;
(gdb) next
56	  int byte_order = (BitmapBitOrder(d) == LSBFirst) ? LSBFirst : MSBFirst;
(gdb) next
57	  XImage* img = XCreateImage(d, visual, depth, ZPixmap, 0, (char*)data, width, height, 32, row);
(gdb) next
58	  if (img == NULL) {
(gdb) next
59	    fprintf(stderr, "JPGのXImageを創作に失敗しました。\n");
(gdb) print d
$1 = (Display *) 0x55555555b330
(gdb) print visual
$2 = (Visual *) 0x555555569ce0
(gdb) print depth
$3 = 24
(gdb) print data
$4 = (unsigned char *) 0x7ffff774e010 "\027)3\027)3\027)3\027)3\027)3\027)3\027)3\027)3\025'1\026(2\027)3\027)3\026(2\027)3\030*4\031+5\031+5\031+5\032,6\031+5\030*4\030*4\027)3\030*4\027)3\030*4\031+5\031+5\031+5\030*4\031+5\031+5\032,8\031+5\031+5\030*4\031,3\031,3\032-4\033.5\0371;\0362;\0362;\0351:\0351:\03219\03219\03108\03409\031-6 4=\0351:,CK\03219\030/7\0334;\03018\0323:\0323:\03219\03219\0351:\0351:\033/8\030/7\03219\0343"...
(gdb) print width
$5 = 840
(gdb) print height
$6 = 405
(gdb) print row
$7 = 2520
(gdb) print img
$8 = (XImage *) 0x0
(gdb) print stderr
$9 = (FILE *) 0x7ffff7d5c4e0 <_IO_2_1_stderr_>
(gdb)

全ての値は正しいなのに、XCreateImageがNULLを創作しているらしい
これを修正して下さい

memcpy()を使うのは安定じゃない なお、JPGファイルをまだ開けられないらしい\ gdbにより: ```gdb GNU gdb (GDB) 13.2 Copyright (C) 2023 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-pc-linux-gnu". Type "show configuration" for configuration details. For bug reporting instructions, please see: <https://www.gnu.org/software/gdb/bugs/>. Find the GDB manual and other documentation resources online at: <http://www.gnu.org/software/gdb/documentation/>. For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from ./mivfx... (gdb) run ~/Eqjk_WgVQAE2psn-new.jpeg Starting program: /home/suwako/dev/now/mivfx/mivfx ~/Eqjk_WgVQAE2psn-new.jpeg This GDB supports auto-downloading debuginfo from the following URLs: <https://debuginfod.artixlinux.org> Enable debuginfod for this session? (y or [n]) y Debuginfod has been enabled. To make this setting permanent, add 'set debuginfod enabled on' to .gdbinit. Downloading separate debug info for system-supplied DSO at 0x7ffff7fc8000 Downloading separate debug info for /usr/lib/libX11.so.6 Downloading separate debug info for /usr/lib/libpng16.so.16 Downloading separate debug info for /usr/lib/libjpeg.so.8 [Thread debugging using libthread_db enabled] Using host libthread_db library "/usr/lib/libthread_db.so.1". Downloading separate debug info for /usr/lib/libxcb.so.1 Downloading separate debug info for /usr/lib/libXau.so.6 Downloading separate debug info for /usr/lib/libXdmcp.so.6 JPGのXImageを創作に失敗しました。 画像を開けられません: /home/suwako/Eqjk_WgVQAE2psn-new.jpeg [Inferior 1 (process 8725) exited with code 01] (gdb) break format/jpg.c:54 Breakpoint 1 at 0x555555557303: file format/jpg.c, line 54. (gdb) run ~/Eqjk_WgVQAE2psn-new.jpeg Starting program: /home/suwako/dev/now/mivfx/mivfx ~/Eqjk_WgVQAE2psn-new.jpeg [Thread debugging using libthread_db enabled] Using host libthread_db library "/usr/lib/libthread_db.so.1". Breakpoint 1, read_jpg (d=0x55555555b330, filename=0x7fffffffe376 "/home/suwako/Eqjk_WgVQAE2psn-new.jpeg") at format/jpg.c:54 54 Visual *visual = DefaultVisual(d, DefaultScreen(d)); (gdb) next 55 int bitmap_order = (ImageByteOrder(d) == LSBFirst) ? LSBFirst : MSBFirst; (gdb) next 56 int byte_order = (BitmapBitOrder(d) == LSBFirst) ? LSBFirst : MSBFirst; (gdb) next 57 XImage* img = XCreateImage(d, visual, depth, ZPixmap, 0, (char*)data, width, height, 32, row); (gdb) next 58 if (img == NULL) { (gdb) next 59 fprintf(stderr, "JPGのXImageを創作に失敗しました。\n"); (gdb) print d $1 = (Display *) 0x55555555b330 (gdb) print visual $2 = (Visual *) 0x555555569ce0 (gdb) print depth $3 = 24 (gdb) print data $4 = (unsigned char *) 0x7ffff774e010 "\027)3\027)3\027)3\027)3\027)3\027)3\027)3\027)3\025'1\026(2\027)3\027)3\026(2\027)3\030*4\031+5\031+5\031+5\032,6\031+5\030*4\030*4\027)3\030*4\027)3\030*4\031+5\031+5\031+5\030*4\031+5\031+5\032,8\031+5\031+5\030*4\031,3\031,3\032-4\033.5\0371;\0362;\0362;\0351:\0351:\03219\03219\03108\03409\031-6 4=\0351:,CK\03219\030/7\0334;\03018\0323:\0323:\03219\03219\0351:\0351:\033/8\030/7\03219\0343"... (gdb) print width $5 = 840 (gdb) print height $6 = 405 (gdb) print row $7 = 2520 (gdb) print img $8 = (XImage *) 0x0 (gdb) print stderr $9 = (FILE *) 0x7ffff7d5c4e0 <_IO_2_1_stderr_> (gdb) ``` 全ての値は正しいなのに、XCreateImageがNULLを創作しているらしい\ これを修正して下さい
suwako が 1 コミット追加 2023-10-24 13:40:09 +09:00
suwako が 1 コミット追加 2023-10-24 17:44:29 +09:00
suwako が 1 コミット追加 2023-10-25 02:41:18 +09:00
作成者
オーナー

要らない

要らない
suwako がプルリクエストをクローズ 2024-04-07 10:38:18 +09:00

プルリクエストはクローズされました

サインインしてこの会話に参加。
レビューアなし
ラベルなし
マイルストーンなし
プロジェクトなし
担当者なし
1 人の参加者
通知
期日
期日が正しくないか範囲を超えています。 'yyyy-mm-dd' の形式で入力してください。

期日は未設定です。

依存関係

依存関係が設定されていません。

リファレンス: suwako/mivfx#1
説明はありません。