Welcome, Guest
Username: Password: Remember me
CodeTyphon MacOS Development, discussions and problems
  • Page:
  • 1

TOPIC:

CT 7.3 Big Sur JPEG issue 3 years 11 months ago #15473

  • Denis D
  • Denis D's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 11
  • Thank you received: 0
Hi,
Thanks for your great job. I just installed CT 7.3 on Mac/intel Big Sur 11.1 and I have issues trying to save (using bgrabitmap) or load in a memorystream a jpeg image :
The error message is : 'DCT coefficient out of range'.
Any idea ?
Thanks a lot, regards.

Please Log in or Create an account to join the conversation.

Last edit: by Denis D.

CT 7.3 Big Sur JPEG issue 3 years 11 months ago #15476

  • Matis A.
  • Matis A.'s Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 1132
  • Thank you received: 170
A sample project to test ?
PilotLogic Core Programmer

Please Log in or Create an account to join the conversation.

Last edit: by Matis A..

CT 7.3 Big Sur JPEG issue 3 years 11 months ago #15477

  • Denis D
  • Denis D's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 11
  • Thank you received: 0
Try this simple code in console app:

Uses

... bgrabitmap, ...


procedure test;
var
abgra:tbgrabitmap;
begin
abgra:=tbgrabitmap.create;
abgra.loadfromfile('afile.png');
abgra.savetofile('afile.jpg');
abgra.free
end;

This creates the error ; I supect an issue with either the libjpeg (the error is within the libjpeg code), or the handling of this libjpeg by freepascal...

Thanks
 

Please Log in or Create an account to join the conversation.

CT 7.3 Big Sur JPEG issue 3 years 11 months ago #15490

  • Denis D
  • Denis D's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 11
  • Thank you received: 0
I also tried using CT 7.3 on MacOSX Catalina ; same bug : DCT coefficient out of range.

Either Free Pascal error, or something else...
Free Pascal version used in CT 7.3 is 3.3.1 ; is it possible to install another FP version (3.2 e.g.), and if yes, how ?
Thanks, regards.

Please Log in or Create an account to join the conversation.

CT 7.3 Big Sur JPEG issue 3 years 11 months ago #15492

  • Matis A.
  • Matis A.'s Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 1132
  • Thank you received: 170
NO you can't install other FPC
ctFPC is NOT the same with "Vanilla FPC".

Your source code is corrects ?
TbgraBitmap work at MacOS ?

Please try to post the above problem at BGRAbitmap support here
PilotLogic Core Programmer

Please Log in or Create an account to join the conversation.

Last edit: by Matis A..

CT 7.3 Big Sur JPEG issue 3 years 11 months ago #15495

  • Denis D
  • Denis D's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 11
  • Thank you received: 0
Thanks, but the problem is the same with TFPwriterJPEG, so I think it's not a TBGRABitmap issue, but a Free Pascal issue, or something else related to FP because this code is working on CT 7.0 and no working on CT 7.3 (error "DCT coefficient out of range") :

uses
FPimage,
  FPReadPNG, FPReadBMP, FPReadGif,
  FPWriteJPEG

function ConvertImage(ImgFile:string):Tmemorystream;
var
  ir: TFPCustomImageReader;
  jw: TFPWriterJPEG;
  im: TFPMemoryImage;
  ex:string;
begin
  ex := StringReplace(UpperCase(ExtractFileExt(imgFile)), '.', '', [rfReplaceAll]);
  if (ex = '') then
    Error('File without an extension!');
  try
    if (ex = 'PNG') then
      ir := TFPReaderPNG.Create
    else
    if ((ex = 'JPG') or (ex = 'JPEG')) then
      ir := TFPReaderJPEG.Create
    else
    if (ex = 'BMP') then
      ir := TFPReaderBMP.Create
    else
    if (ex = 'GIF') then
      ir := TFPReaderGif.Create
    else
      Error('Invalid extension from image: ' + ex);
    im := TFPMemoryImage.Create(0, 0);
    jw := TFPWriterJPEG.Create;
    im.LoadFromFile(imgFile, ir);
    Result := TMemoryStream.Create;
    im.SaveToStream(Result, jw);   
  finally
    ir.Free;
    im.Free;
    jw.Free;
  end;
end;

Please Log in or Create an account to join the conversation.

  • Page:
  • 1