• Welcome to Vampyre Imaging Library Forum. Please login or sign up.
 
24 January 2020, 06:43:55

News:

Imaging 0.26.4 Released!


Recent posts

Pages1 2 3 4 ... 10
1
Yes, it is planned. Progress on Imaging is very slow but WebP is now one of the top priorities.

So far there is this contribution I received (attached, FPC only).
2
Are there any plans to add support for the WebP Image File Format?

It seems as if this format is getting more and more important since it is increasingly used in websites.
3
Help & Questions / Re: MacOs 64
Last post by JordiMOnty - 26 August 2019, 12:38:54
It works! Thank you very much!
4
Help & Questions / Re: MacOs 64
Last post by Galfar - 7 August 2019, 01:13:21
It's fixed now.
Many changes were needed actually, Delphi macOS and Linux 64bit targets have LongInt/LongWord 64bit in size. It stays 32bit for Win64 and for all FPC targets.
5
Help & Questions / Re: MacOs 64
Last post by Galfar - 3 August 2019, 23:56:14
I've updated my Delphi Community Ed. so I can have a look at this in next few days.
6
Help & Questions / MacOs 64
Last post by JordiMonty - 1 August 2019, 17:52:13
Hello, I'm testing new Delphi 10.3 to build a MacOs64 bit application, and the library only compiles in 32bit mode.

TLongIntArray = array[0..MaxInt div 4 - 1] of LongInt;
[dccosx64 Error] ImagingUtility.pas(47): E2100 Data type too large: exceeds 2 GB

Are there any plans to support it?

Thank you,
Jordi
7
Bugs And Other Insects / Re: Range error when adding im...
Last post by Galfar - 3 July 2019, 16:31:30
Thanks for the fixes, I'll add them to the repository.
TSingleImage and especially TMultiImage are not used and tested that much unfortunately.
8
Bugs And Other Insects / Range error when adding images...
Last post by Patman - 3 July 2019, 15:03:13
Windows 7 x64
Delphi RAD Studio 10.2
Vampyre Imaging latest snapshot
-----

Error occurs when adding mipmaps to MultiImage before exporting to DDS. Like this:

Code (pascal) Select
var
  LImage: TMultiImage;
  LImageCanvas: TImagingCanvas;
  LImageMipMaps: TDynImageDataArray;
begin
          ...
          LImage.Format := ifDXT5;
          Imaging.GenerateMipMaps(LImage.ImageDataPointer^, 10, LImageMipMaps);
          LImage.AddImages(LImageMipMaps);
          FreeImagesInArray(LImageMipMaps);
          LImage.SaveMultiToFile(ToDir + ToMaterial + '.dds');
          ...
end;


LImage has only 1 image when AddImages is called to add 10 mipmaps.
Getting range error from System.Move operation in ImagingClasses::PrepareInsert:

Code (pascal) Select
function TMultiImage.PrepareInsert(Index, Count: Integer): Boolean;
var
  I: Integer;
begin
  // Inserting to empty image will add image at index 0
  if GetImageCount = 0 then
    Index := 0;

  if (Index >= 0) and (Index <= GetImageCount) and (Count > 0) then
  begin
    SetLength(FDataArray, GetImageCount + Count);
    if Index < GetImageCount - 1 then
    begin
      // Move imges to new position
      System.Move(FDataArray[Index], FDataArray[Index + Count],
        (GetImageCount - Count - Index) * SizeOf(TImageData));
      // Null old images, not free them!
      for I := Index to Index + Count - 1 do
        InitImage(FDataArray[I]);
    end;
    Result := True;
  end
  else
    Result := False;
end;


The System.Move and InitImage loop are for handling insertions via InsertImage(s) procedures, but it is also executed for all AddImage(s) procedures, which always add to the end of the array.
I changed it to the following (not tested for all InsertImage(s) and AddImage(s) operations):

Code (pascal) Select
function TMultiImage.PrepareInsert(Index, Count: Integer): Boolean;
var
  I, LImageCount: Integer;
begin
  // Inserting to empty image will add image at index 0
  LImageCount := GetImageCount;
  if LImageCount = 0 then
    Index := 0;

  if (Index >= 0) and (Index <= LImageCount) and (Count > 0) then
  begin
    SetLength(FDataArray, LImageCount + Count);
    if Index <= LImageCount - 1 then
    begin
      // Move images to new position
      System.Move(FDataArray[Index], FDataArray[Index + Count], (GetImageCount - Count - Index) * SizeOf(TImageData));
      // Null old images; do not free them!
      for I := Index to Index + Count - 1 do
        InitImage(FDataArray[I]);
    end;
    Result := True;
  end
  else
    Result := False;
end;



Secondly, this appears to be a bug:

Code (pascal) Select
procedure TMultiImage.InsertImages(Index: Integer;
  const Images: TDynImageDataArray);
begin
  DoInsertImages(Index, FDataArray);
end;


Which should be:

Code (pascal) Select
procedure TMultiImage.InsertImages(Index: Integer;
  const Images: TDynImageDataArray);
begin
  DoInsertImages(Index, Images);
end;

9
Help & Questions / Re: Cropping image possible?
Last post by pka4916 - 31 May 2019, 19:03:59
Thanks.
I figured it out with what you mentioned :)
10
Help & Questions / Re: Cropping image possible?
Last post by Galfar - 31 May 2019, 15:47:53
There's no simple CropImage function but you can
do the two steps that CropImage would do:

1. Create new image with size the same as desired crop rectangle (NewImage)
2. Copy part of the original image to the new one (CopyRect) with proper SrcX and SrcY parameters.
Pages1 2 3 4 ... 10