processing / processing/processing4

.tga PImage flips y axis after save() and load()

オープン
#827 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

bug core
主要言語
Java
スター
497
フォーク
183
平均マージ
4時間 39分
マージ済み PR(30日)
3

説明

Created by: Sebastian5

Description

ONLY when pixels are saved ( PImage.save() ) as .tga and loaded again ( loadImage() ) they are fliped on the y axis.

Expected Behavior

That the image doesnt flip.
The demo code should show the red dot in the top left corner, not the bottom left.

Current Behavior

It is unclear whether the PImage.save() or loadImage() function is the root of the bug.

The Problem does NOT occur when:
If you save and image as .tga and open it with Paint.net: looks correct in Paint.net, not flipped
If you load an .tga created from Paint.net: looks correct in Processing, not flipped

But for .tga images that were PImage.save() and loadImage(). It flipps the pixels. It is very strange

Steps to Reproduce

PImage img1 = createImage(5, 5, RGB);
img1.pixels[0] = color(255,0,0); // left top corner must be red
img1.updatePixels();
img1.save("img.tga");

PImage img2 = loadImage("img.tga"); // comment out after using Paint.net to re-save image non corrupt
image(img2,0,0, width, height);

Your Environment

  • Processing version: 4.3
  • Operating System and OS version: Windows 10 Pro 22H2
  • Other information: AMD GPU Andrenail 23.12.1, Intel CPU

Possible Causes / Solutions

Maybe there is file desciptor flag to flip an image in the y axis.

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

.tga の処理に関係する PImage.save() と loadImage() のパスから始め、提供された 5×5 の再現手順を Processing 4.3 で実行します。保存または読み込みによってピクセルの垂直方向の順序が変わるかを追跡します。TGA を保存して読み込んだ後も赤いピクセルが左上に残っていれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
java
領域
computer-graphics
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。