OS X: com.apple.desktoppicture folder grows when changing the wallpaper

Originator:francesc.bgr
Number:rdar://27393406 Date Originated:17-Jul-2016 03:48 PM
Status:Open Resolved:
Product:OS X Product Version:10.11
Classification: Reproducible:Always
 
Summary:
The system folder com.apple.desktoppicture created inside /private/var/folders/**/** grows out of control when changing the wallpaper.

Steps to Reproduce:
1. Change systematically the wallpaper using API: 
[NSWorkspace setDesktopImageURL:forScreen:options:error:] using images not in PNG format and of different resolution than your screen
2. Find your /private/var/folders/**/**/com.apple.desktoppicture


Expected Results:
1. Change systematically the wallpaper using API: 
[NSWorkspace setDesktopImageURL:forScreen:options:error:] using images not in PNG format and of different resolution than your screen
2. Find your /private/var/folders/**/**/com.apple.desktoppicture
3. Folder size should keep constrained using a limited disk space

Actual Results:
3. Watch it size grow –the older optimized wallpapers are not deleted.

Version:
10.11.3 (15D21)

Notes:
This can be solved by passing a PNG image that has the same resolution as the screen to [NSWorkspace setDesktopImageURL:forScreen:options:error]. There are users reporting sizes of 7+GB (https://github.com/ifrins/Snappr/issues/3)

Configuration:

Comments

Engineering has determined that this issue behaves as intended based on the following information:

They are cached, deleted under disk pressure.

By francesc.bgr at Feb. 21, 2017, 8:40 p.m. (reply...)

Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!