LazEdit: lazedit_picslib.pp: uses TFileStreamUtf8 for better UTF8 support on Windows.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2756 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
parent
b36311669c
commit
eb63b9a138
@ -4,7 +4,7 @@ unit LazEdit_PicsLib;
|
||||
|
||||
interface
|
||||
|
||||
uses SysUtils, Classes, Math;
|
||||
uses SysUtils, Classes, Math, LazUtf8Classes;
|
||||
|
||||
type
|
||||
TImageFormat = (ifUnknown, ifBmp, ifPng, ifGif, ifJpg);
|
||||
@ -325,13 +325,13 @@ end;
|
||||
|
||||
function GetImageSizeAndFormat(const Fn: String; out Width, Height: dword): TImageFormat;
|
||||
var
|
||||
ImgStream: TFileStream;
|
||||
ImgStream: TFileStreamUtf8;
|
||||
ImgFormat: TImageFormat;
|
||||
begin
|
||||
Width := 0;
|
||||
Height := 0;
|
||||
try
|
||||
ImgStream := TFileStream.Create(Fn,fmOpenRead or fmShareDenyNone);
|
||||
ImgStream := TFileStreamUtf8.Create(Fn,fmOpenRead or fmShareDenyNone);
|
||||
try
|
||||
ImgStream.Position := 0;
|
||||
ImgFormat := GetImageFormatAndDimensions(ImgStream, ExtToImageFormat(ExtractFileExt(Fn)), Width, Height);
|
||||
|
@ -87,7 +87,7 @@ begin
|
||||
FInitialDir := ExtractFileDir(Fn);
|
||||
SrcEdit.Text := ExtractFileName(Fn);
|
||||
//GetImageSize uses system encoding
|
||||
if GetImageSize(Utf8ToSys(Fn), W, H) then
|
||||
if GetImageSize(Fn, W, H) then
|
||||
begin
|
||||
WidthEdit.Text := IntToStr(W);
|
||||
HeightEdit.Text := IntToStr(H);
|
||||
|
Loading…
Reference in New Issue
Block a user