ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 After saving JPEG with ioJPEG_RGB this JPEG loads with red and blue inverted
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

Gijs-albelli

Netherlands
1 Posts

Posted - Apr 01 2022 :  09:27:26  Show Profile  Reply
The code below demonstrates the problem. This happens with ImageEn 10.3.5

You can load a JPEG file in ImageEnViewOriginal, when you save this file in a new name with
ImageEnViewOriginal.IO.Params.JPEG_ColorSpace := ioJPEG_RGB;

and you load this file in the other ImageEnViewCopy, the red and blue are converted.

Is this a bug? Or can we work around it. We are planning to upgrade our ImageEN components but this is a show stopper for us.



unit uFormMain;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.ExtCtrls, Vcl.ComCtrls, hyiedefs,
  hyieutils, iexBitmaps, iesettings, iexLayers, iexRulers, iexToolbars,
  iexUserInteractions, imageenio, imageenproc, ieview, imageenview, Vcl.ExtDlgs,
  Vcl.StdCtrls;

type
  TFormMain = class(TForm)
    PanelLeft: TPanel;
    StatusBar1: TStatusBar;
    Splitter1: TSplitter;
    PanelClient: TPanel;
    PanelLeftTop: TPanel;
    PanelClientTop: TPanel;
    ImageEnViewOriginal: TImageEnView;
    ImageEnViewCopy: TImageEnView;
    OpenPictureDialog: TOpenPictureDialog;
    ButtonLoad: TButton;
    ButtonSaveAsAndLoad: TButton;
    procedure ButtonLoadClick(Sender: TObject);
    procedure ButtonSaveAsAndLoadClick(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  FormMain: TFormMain;

implementation

{$R *.dfm}

procedure TFormMain.ButtonLoadClick(Sender: TObject);
begin
  if OpenPictureDialog.Execute then
  begin
    ImageEnViewOriginal.IO.LoadFromFile(OpenPictureDialog.FileName);
    ButtonSaveAsAndLoad.Enabled := True;
  end;
end;

procedure TFormMain.ButtonSaveAsAndLoadClick(Sender: TObject);
var
  folder,
  uniqueName,
  extension,
  newFileName: string;
begin
  folder := ExtractFilePath(OpenPictureDialog.FileName);
  uniqueName := TGuid.NewGuid.ToString();
  extension := ExtractFileExt(OpenPictureDialog.FileName);
  newFileName := folder + uniqueName + extension;
  ImageEnViewOriginal.IO.Params.JPEG_ColorSpace := ioJPEG_RGB;  // this causes the invert of red and blue while loading
  ImageEnViewOriginal.IO.SaveToFileJpeg(newFileName);
  ImageEnViewCopy.IO.LoadFromFileJpeg(newFileName);
end;

end.



xequte

38610 Posts

Posted - Apr 03 2022 :  19:04:05  Show Profile  Reply
Thank you. This is fixed in the current beta. You can email us for it you like.

Nigel
Xequte Software
www.imageen.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: