ecere/gfx/Bitmap: Fixed loading from file at current position
authorJerome St-Louis <jerome@ecere.com>
Sat, 19 Oct 2013 05:41:06 +0000 (01:41 -0400)
committerJerome St-Louis <jerome@ecere.com>
Sat, 19 Oct 2013 05:41:06 +0000 (01:41 -0400)
- Previously broken by 61f70093a82be11336467c6e3f177f1c911fa50d
- Acovel relied on this behavior to load pictures from ID3 tags

ecere/src/gfx/Bitmap.ec

index fc0973e..da4aa03 100644 (file)
@@ -472,6 +472,7 @@ public:
       {
          subclass(BitmapFormat) format = null;
          int typeToTry = -1;
+         uintsize pos = file.Tell();
 
          if(type)
             format = FindFormat(type);
@@ -481,7 +482,7 @@ public:
 
          for(; typeToTry < NUM_TYPES_TO_TRY; typeToTry++)
          {
-            file.Seek(0, start);
+            file.Seek(pos, start);
             if(typeToTry >= 0)
                format = FindFormat(typesToTry[typeToTry]);