Jump to content
You must now use your email address to sign in [click for more info] ×

Why is this empty file 1.3 MB large?


Recommended Posts

I'm wondering why this file is 1.3 MB large even though it has no content anymore. With the content (a few icons, nothing complex) it was 1.4 MB. I was surprised and tried to find the mysteriously complex shape by deleting one after the other. In the end, there was nothing left and the file size hasn't really gone down. The colour space is sRGB, even if the profile was embedded I'd not expect more than a few tens of kB. An SVG export of the whole document is 13 kB.

Maybe a developer could inspect this file and tell me why it needs to be so large and what I can do about it. I have other files here that contain just a few icons (same style) of 40-50 kB. That's a much more reasonable file size.

The original file contains icons that I have designed with Affinity Designer and exported to SVG for use in a web application. It also contains construction layers that I merged for the SVG export. I'd like to add the .afdesign file to the code repository so it's with the app code. But I'm hesitating to check in an image file that more than doubles the repository size.

ItemTypes-2.afdesign

Link to comment
Share on other sites

Try SaveAs.

Or try search in the forum, size of the files is discussed here repeatedly.

Affinity Store (MSI/EXE): Affinity Suite (ADe, APh, APu) 2.4.0.2301
Dell OptiPlex 7060, i5-8500 3.00 GHz, 16 GB, Intel UHD Graphics 630, Dell P2417H 1920 x 1080, Windows 11 Pro, Version 23H2, Build 22631.3155.
Dell Latitude E5570, i5-6440HQ 2.60 GHz, 8 GB, Intel HD Graphics 530, 1920 x 1080, Windows 11 Pro, Version 23H2, Build 22631.3155.
Intel NUC5PGYH, Pentium N3700 2.40 GHz, 8 GB, Intel HD Graphics, EIZO EV2456 1920 x 1200, Windows 10 Pro, Version 21H1, Build 19043.2130.

Link to comment
Share on other sites

2 minutes ago, Pšenda said:

Try SaveAs.

I tried that with the OP's file on my Mac & still got a new file of the same size as the original. Dropping the file into BBEdit shows it has lots of data in it but I can't make any sense of what it represents.

All 3 1.10.8, & all 3 V2.4.1 Mac apps; 2020 iMac 27"; 3.8GHz i7, Radeon Pro 5700, 32GB RAM; macOS 10.15.7
Affinity Photo 
1.10.8; Affinity Designer 1.108; & all 3 V2 apps for iPad; 6th Generation iPad 32 GB; Apple Pencil; iPadOS 15.7

Link to comment
Share on other sites

In AD 1.10 creating an identical file from scratch is 1,393,111 bytes (1.4 MB on disk), in AD 1.73 the same blank file is 388,211 bytes (389 KB on disk). No idea why the balloon in size.

Affinity Designer 2.4.1.2344 | Affinity Photo 2.4.1.2344 | Affinity Publisher 2.4.1.2344
Affinity Designer 1.7.3 | Affinity Photo 1.7.3 | Affinity Publisher 1.10.8
MacBook Pro 16GB, macOS Monterey 12.6.8, Magic Mouse

Link to comment
Share on other sites

1 hour ago, Hangman said:

in AD 1.73 the same blank file is 388,211 bytes (389 KB on disk)

In 1.10.5.1342 blank/new file is 6 676 bytes. Document has 16 x 16 px (although it is primarily a vector document, its dimensions affect the file size).

 

10 hours ago, R C-R said:

I tried that with the OP's file on my Mac & still got a new file of the same size as the original.

It's even a little bigger for me.
The note about SaveAs was meant in the context of the nature of the Affinity data file, which is not only used to store information about document objects, but is also a kind of intermediate product of work data, when the deletion of an object does not immediately affect the size of the document. The size of the document is adjusted/compressed only if there is a significant change (I think it was 30%). SaveAs should then perform this modification of the stored data.

 

14 hours ago, ygoe said:

he original file contains icons that I have designed with Affinity Designer

Maybe the original file would be interesting too. Did you not use any Symbols, Fills with images, ...? Just something that was used only as a pattern, and after removing the object - to which it was applied, the source data remained there.

14 hours ago, ygoe said:

I'd like to add the .afdesign file to the code repository so it's with the app code.

I would try the reverse procedure - first create a new/empty file, and then gradually add/copy individual objects/icons to it. Then you can possibly find out which object/icon is responsible for the increase in file size, or the size stays at a reasonable value.

Affinity Store (MSI/EXE): Affinity Suite (ADe, APh, APu) 2.4.0.2301
Dell OptiPlex 7060, i5-8500 3.00 GHz, 16 GB, Intel UHD Graphics 630, Dell P2417H 1920 x 1080, Windows 11 Pro, Version 23H2, Build 22631.3155.
Dell Latitude E5570, i5-6440HQ 2.60 GHz, 8 GB, Intel HD Graphics 530, 1920 x 1080, Windows 11 Pro, Version 23H2, Build 22631.3155.
Intel NUC5PGYH, Pentium N3700 2.40 GHz, 8 GB, Intel HD Graphics, EIZO EV2456 1920 x 1200, Windows 10 Pro, Version 21H1, Build 19043.2130.

Link to comment
Share on other sites

4 hours ago, Hangman said:

In AD 1.10 creating an identical file from scratch is 1,393,111 bytes (1.4 MB on disk)...

Not for me n my Mac. Two examples attached, each with different document dimensions & transparencies, & one with the other without an Artboard. Neither one is more than 9KB.

test 800px.afdesign test 4096.afdesign

All 3 1.10.8, & all 3 V2.4.1 Mac apps; 2020 iMac 27"; 3.8GHz i7, Radeon Pro 5700, 32GB RAM; macOS 10.15.7
Affinity Photo 
1.10.8; Affinity Designer 1.108; & all 3 V2 apps for iPad; 6th Generation iPad 32 GB; Apple Pencil; iPadOS 15.7

Link to comment
Share on other sites

18 hours ago, ygoe said:

The colour space is sRGB, even if the profile was embedded I'd not expect more than a few tens of kB.

I wonder if it is caused by a "sticky" profile, maybe of a former resource?

I was able to solve it by changing the document's colour space. To force a change I placed an image first that I deleted in the last step. Maybe the 3rd (rgb generic) step was not necessary. (Note: just placing an image + save + delete + save did not alter the file size, so it required a profile change)

The file names tell the changes + file size. Finally it resulted again in an empty document in sRGB profile but with 46 kB (instead its initial 1.4 MB). ItemTypes-2_empty_srgb.afdesign

1892771488_reducefilesizebycolorprofile.jpg.702fd378620fcbe7bed454f42b42ca65.jpg

macOS 10.14.6 | MacBookPro Retina 15" | Eizo 27" | Affinity V1

Link to comment
Share on other sites

  • Staff

Hi @ygoe,

Evidently the file is holding onto data which is no longer required as re-creating the file from blank results in a more reasonable 46KB so i've logged this with the developers to take a look at.

@thomaso after following your steps my file size remained as 1.4mb throughout all 4 steps/files on Mac, so i'm not exactly sure what's different, perhaps the image being placed?

Link to comment
Share on other sites

1 minute ago, NathanC said:

after following your steps my file size remained as 1.4mb throughout all 4 steps/files on Mac, so i'm not exactly sure what's different, perhaps the image being placed?

I doubt it was the particular image (rgb, jpg, – I just picked any from the top of my file list).

But I remember I toggled it from being embedded (as set in the OP's document) to being linked in my _image.afdesign, to possibly force an additional change of the saved data. (I am not sure if I did a first save with the embedded image – or changed its property directly after placing the image and thus before saving.)

In this .zip are all 5 .afdesigns + the used image, in case it might help to investigate. empty file size 1-5.zip

macOS 10.14.6 | MacBookPro Retina 15" | Eizo 27" | Affinity V1

Link to comment
Share on other sites

37 minutes ago, NathanC said:

Evidently the file is holding onto data which is no longer required as re-creating the file from blank results in a more reasonable 46KB so i've logged this with the developers to take a look at.

I'm curious about what settings you used for your "blank " version of the OP's file. When I open the OP's version, in Document Setup I get a 16 x 16 px, 72 DPI RGB/8 document with a transparent background, no margins & zero bleeds, with a Prefer Embedded Image Placement Policy, & no artboard, just a single canvas.

When I use those same settings for a new from scratch AD file like in this Empty test 3.afdesign example, the file is about 8 KB on disk, about the same as in my other test files already posted above.

All 3 1.10.8, & all 3 V2.4.1 Mac apps; 2020 iMac 27"; 3.8GHz i7, Radeon Pro 5700, 32GB RAM; macOS 10.15.7
Affinity Photo 
1.10.8; Affinity Designer 1.108; & all 3 V2 apps for iPad; 6th Generation iPad 32 GB; Apple Pencil; iPadOS 15.7

Link to comment
Share on other sites

  • Staff
15 hours ago, R C-R said:

When I use those same settings for a new from scratch AD file like in this Empty test 3.afdesign example, the file is about 8 KB on disk, about the same as in my other test files already posted above.

Had my files mixed up with thomaso's when I was trying to replicate the reduced file size, I've created a blank new file again following the original file specs which has resulted in a 8KB empty file.

16 hours ago, thomaso said:

But I remember I toggled it from being embedded (as set in the OP's document) to being linked in my _image.afdesign, to possibly force an additional change of the saved data. (I am not sure if I did a first save with the embedded image – or changed its property directly after placing the image and thus before saving.)

In this .zip are all 5 .afdesigns + the used image, in case it might help to investigate. empty file size 1-5.zip

Thanks for this, i've been able to replicate this with your files and added the details onto the report. 🙂

Link to comment
Share on other sites

2 hours ago, NathanC said:

added the details onto the report.

I generally wonder why a native Affinity document gets its document profile embedded. This causes in particular for a CMYK document colour space a file size around 1-2 MB even if it contains just text. I see the advantage of profile embedding if a native Affinity file gets transferred to a different computer – but for all other daily cases it appears more useful to just "note" the profile, like PDF/X can do with its profile Output Intent.

macOS 10.14.6 | MacBookPro Retina 15" | Eizo 27" | Affinity V1

Link to comment
Share on other sites

Something odd is definitely going on, when I first created a 16px x 16px file using the exact same settings and saved the file was 1.4mb in size and now creating the exact same file again it’s only 7kb. I have both sitting in the same folder side by side showing massively different file sizes which makes no sense!

Affinity Designer 2.4.1.2344 | Affinity Photo 2.4.1.2344 | Affinity Publisher 2.4.1.2344
Affinity Designer 1.7.3 | Affinity Photo 1.7.3 | Affinity Publisher 1.10.8
MacBook Pro 16GB, macOS Monterey 12.6.8, Magic Mouse

Link to comment
Share on other sites

  • 2 months later...
4 hours ago, ygoe said:

Has anybody found out what the issue is and fixed it? I'd like to reduce the size of my file soon. If the bug still exists, what workarounds do exist to repair that file?

In my experience with your .afdesign its large size appeared to be influenced by color profile(s) and it got reduced from 1.4 MB to 46 kB.  See above.

macOS 10.14.6 | MacBookPro Retina 15" | Eizo 27" | Affinity V1

Link to comment
Share on other sites

18 hours ago, thomaso said:

In my experience with your .afdesign its large size appeared to be influenced by color profile(s) and it got reduced from 1.4 MB to 46 kB.  See above.

I'm sorry I have no clue what you did there. I tried this:

  1. Create a new .afphoto file in CMYK/8 colour format
  2. Add that image to the afdesign file
  3. Change the afdesign file from RGB/8 to CMYK/8
  4. Save
  5. Close and reopen
  6. Change file back to RGB/8
  7. Delete the inserted image
  8. Save

Now the file is a few hundred bytes larger than what I started with.

Please someone official make a statement if this bug is being considered and how I can repair my existing file. I can also send you the original file for repair if I cannot do it myself with the public software.

Link to comment
Share on other sites

5 minutes ago, ygoe said:

I'm sorry I have no clue what you did there. I tried this:

  1. Change file back to RGB/8
  2. Delete the inserted image
  3. Save

Now the file is a few hundred bytes larger than what I started with.

The difference was in my last steps I first deleted the image and then switched one more time to a different RGB profile.

But nevertheless, actually it doesn't matter how I got to my 46 kB. I agree, it should not happen at all – in particular since other users mentioned above it would not occur in an old Affinity version 1.7.x., and an empty file would have 6.6 respectively 7 kB.

Now I created & saved an .afphoto in v1.10.5 an empty 16x16 px, sRGB and got 48 kB.

macOS 10.14.6 | MacBookPro Retina 15" | Eizo 27" | Affinity V1

Link to comment
Share on other sites

The moderators already assigned a bug tag to this thread, so it is acknowledged.

But the file is not damaged as far as i understand. The native .afdesign etc file format is not intended as final format with lowest storage size. It is a format intended for intermediate data as work status, and often contains old data, no “garbage collection “ is enforced. You can export any time into other formats to reduce file size.

Mac mini M1 A2348 | Windows 10 - AMD Ryzen 9 5900x - 32 GB RAM - Nvidia GTX 1080

LG34WK950U-W, calibrated to DCI-P3 with LG Calibration Studio / Spider 5

iPad Air Gen 5 (2022) A2589

Special interest into procedural texture filter, edit alpha channel, RGB/16 and RGB/32 color formats, stacking, finding root causes for misbehaving files, finding creative solutions for unsolvable tasks, finding bugs in Apps.

 

Link to comment
Share on other sites

22 minutes ago, ygoe said:

8. Save

Try Save As.

Affinity Store (MSI/EXE): Affinity Suite (ADe, APh, APu) 2.4.0.2301
Dell OptiPlex 7060, i5-8500 3.00 GHz, 16 GB, Intel UHD Graphics 630, Dell P2417H 1920 x 1080, Windows 11 Pro, Version 23H2, Build 22631.3155.
Dell Latitude E5570, i5-6440HQ 2.60 GHz, 8 GB, Intel HD Graphics 530, 1920 x 1080, Windows 11 Pro, Version 23H2, Build 22631.3155.
Intel NUC5PGYH, Pentium N3700 2.40 GHz, 8 GB, Intel HD Graphics, EIZO EV2456 1920 x 1200, Windows 10 Pro, Version 21H1, Build 19043.2130.

Link to comment
Share on other sites

3 minutes ago, Pšenda said:

Try Save As.

Same result. I cannot reduce the file size by anything the application allows me to do.

And I do think that removing old and unused junk is a defined behaviour of a file format. Would you like your master document file of a complex drawing to have an extra 100 MB size just because AD doesn't care to free old stuff? This file is indeed intended to be archived for a long time and used as basis for new developments. I already export parts of it to SVG for the final application, but this master file is also part of the source code and it just blows up the version control repository with every single modification. If that 1.5 MB file can also be 50 kB, I want it small, please. And not in 10 years. Recreating it is not an option because it contains dozens of layers and groups. All of them would be lost when exporting in a foreign format. As I see it, AD is just not reliable with its own file handling. You call it cleanup, I call it repair.

Link to comment
Share on other sites

10 minutes ago, ygoe said:

And I do think that removing old and unused junk is a defined behaviour of a file format.

 

Affinity Store (MSI/EXE): Affinity Suite (ADe, APh, APu) 2.4.0.2301
Dell OptiPlex 7060, i5-8500 3.00 GHz, 16 GB, Intel UHD Graphics 630, Dell P2417H 1920 x 1080, Windows 11 Pro, Version 23H2, Build 22631.3155.
Dell Latitude E5570, i5-6440HQ 2.60 GHz, 8 GB, Intel HD Graphics 530, 1920 x 1080, Windows 11 Pro, Version 23H2, Build 22631.3155.
Intel NUC5PGYH, Pentium N3700 2.40 GHz, 8 GB, Intel HD Graphics, EIZO EV2456 1920 x 1200, Windows 10 Pro, Version 21H1, Build 19043.2130.

Link to comment
Share on other sites

19 minutes ago, ygoe said:

Recreating it is not an option because it contains dozens of layers and groups. All of them would be lost when exporting in a foreign format.

FWIW, maybe this workaround may work for you: I just noticed for v1.10.5 that only AD creates that size for an empty file (16x16 px / sRGB). If I create one in APub and import the large .afdesign via the command "Add Pages From File" than the resulting 2 page .afpub still has its 50 kB as before the import of the empty .afdesign. So the question is of course whether it would work for you that artboards get turned to pages this way … and whether it still work this way with contents.

1367031320_v1105empty16pxsRGBfilesize.jpg.21ca774c4ded718c04adf5524db9e026.jpg

macOS 10.14.6 | MacBookPro Retina 15" | Eizo 27" | Affinity V1

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.