View Issue Details

IDProjectCategoryView StatusLast Update
0001452JEDI VCL00 JVCL Componentspublic2004-04-02 11:00
ReporteranonymousAssigned Touser72 
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
Product Version 
Target VersionFixed in Version 
Summary0001452: TjvGIFImage incorrectly saves in a file
DescriptionTjvGIVImage (jvGif) incorrectly saves in a file, at replacement on TGIFImage(rxGIF) all works normal.
Additional Informationexample see in attachment.
TagsNo tags attached.

Activities

2004-03-08 16:37

 

testgif.rar (6,078 bytes)

remkobonte

2004-03-08 18:19

developer   ~0003266

This is introduced by the bugfix for 0000780.

If you don't divide by 3 it works okay in this case.

2004-03-08 21:12

 

testgif_ver2.rar (6,123 bytes)

anonymous

2004-03-08 21:15

viewer   ~0003267

If it is an error in BitmapToMemoryStream why in the original (rxGIF) this error does not arise? (see attach testgif_ver2.rar)

user72

2004-03-09 01:56

  ~0003272

The problem is caused by the PixelFormat of the source bitmap being pfDevice in your example. Changing it to pf24bit, it works. So the problem is really how BitmapToMemoryStream should handle pfDevice...

user72

2004-03-09 02:01

  ~0003273

Current implementation also works with all other pixelformats (pf1bit-pf32bit), except for pfDevice...

user72

2004-03-09 02:15

  ~0003274

Last edited: 2004-03-09 02:15

How about this:

function BitmapToMemoryStream(Bitmap: TBitmap; PixelFormat: TPixelFormat;
  Method: TMappingMethod): TMemoryStream;
...

// at the end:

      Result := TMemoryStream.Create;
      try
        Result.Write(P^, Length);
        if Bitmap.PixelFormat = pfDevice then
          Result.Write(Bits^, ImageSize)
        else
          Result.Write(Bits^, ImageSize div 3);

        Result.Position := 0;
      except
        Result.Free;
        raise;
      end;

edited on: 03-09-04 02:15

remkobonte

2004-03-09 14:16

developer   ~0003289

I don't totally grasp what is going on in that procedure, but that seems correct; I think I'll write a DUnit program for those procedures.

user72

2004-03-10 06:46

  ~0003297

Neither do I, but I've committed the proposed change. Let's see if that solves things...

user72

2004-04-02 11:00

  ~0003594

Since no feedback, assuming it works.

Issue History

Date Modified Username Field Change
2004-03-08 16:37 anonymous New Issue
2004-03-08 16:37 anonymous File Added: testgif.rar
2004-03-08 18:19 remkobonte Note Added: 0003266
2004-03-08 21:12 anonymous File Added: testgif_ver2.rar
2004-03-08 21:15 anonymous Note Added: 0003267
2004-03-09 01:56 user72 Note Added: 0003272
2004-03-09 02:01 user72 Note Added: 0003273
2004-03-09 02:15 user72 Note Added: 0003274
2004-03-09 02:15 user72 Status new => assigned
2004-03-09 02:15 user72 Assigned To => user72
2004-03-09 02:15 user72 Note Edited: 0003274
2004-03-09 14:16 remkobonte Note Added: 0003289
2004-03-10 06:46 user72 Note Added: 0003297
2004-04-02 11:00 user72 Status assigned => resolved
2004-04-02 11:00 user72 Resolution open => fixed
2004-04-02 11:00 user72 Note Added: 0003594