# How to remove Downloaded Smart Previews from folders



## Juju (Dec 18, 2018)

Hi, recently my catalog was corrupted so I created a new catalog and imported all my previous photos from the old catalog to the new one on my Lightroom Classic.  Then I realised I had to re-sync my photos from my Classic to CC because Lightroom CC can only sync one catalog at a time.  When I tried to sync to the new catalog, there was a dialog box which said the photos already synced will be added to the catalog.  So I clicked yes as it was the only option.  Then as the photos starting syncing, I realised the photo count in my new catalog and also my folder kept increasing.  Then I realised it was because as they are syncing, Lightroom keeps adding preview photos to folders called Downloaded Smart Previews in my folders (where the original photos are stored).  I deleted all my synced photos from Lightroom CC but they are still there.  How do I remove the previews and the folders?  Thanks!


----------



## Jim Wilde (Dec 19, 2018)

I'm not entirely sure why you have some "Downloaded Smart Previews" folders, though I suspect it's a possible consequence of the settings on the Preferences>Lightroom Sync tab. A screenshot of that tab would help to better understand why they are created (they don't appear when I try to recreate the circumstances of your event, but likely I'm using different settings for the location of downloaded ecosystem images). 

Do those "Downloaded Smart Previews" folders actually contain data (open one in Finder to see what the contents are), or are they simply placeholders? A screenshot of one of them would also be helpful.


----------



## Victoria Bampton (Dec 19, 2018)

I suspect those Downloaded Smart Previews are it downloading the smart preview dng's from the cloud because it doesn't realize you have the originals. It's a rescue mechanism gone wrong in this case.

When you say you deleted all your synced photos from LR CC, when and how did you do that?


----------



## Juju (Dec 19, 2018)

I deleted the synced photos from Lightroom CC after seeing those Downloaded Smart Previews folders in my Lightroom Masters folders (which is where the original photos are).  I thought that would help prevent further DSP folders from being created.  I deleted those photos by going to the online photo editor for LR CC and then selecting delete all photos.  After that, I tested by syncing a few collections from my LR Classic to LR CC, and I don't have the problem of DSP folders being created and no increasing photo count!  So I think it is safe for me to continue to sync my other collections all over again.  But now, how do I get rid of those DSP folders?  Some of them contain DNG files.

I also noticed another thing:  The reason why the photo count kept going up when I was syncing the photos from LR Classic is because DNG files kept being added to the photos (I see all these DNG files in the "All Photographs" album).  But when I try to click on these DNG and try to locate them in the DSP photos, they cannot be found.  So some or most of them are "phantom" photos in my catalog but they dont even exist in the DSP folders.  What is happening?  I probably dont need these DNG files, but I'm not sure.  I don't even know what they are.


----------



## Victoria Bampton (Dec 20, 2018)

Ok, that makes sense. In that case, you just need to select the Downloaded Smart Previews folders. You can select multiple at once by holding down the Cmd key when you click on them. All of the smart previews photos should show in the Grid view, so select them all and delete. Then with the folders still selected, right-click on a folder and choose Remove to get rid of the empty folders.


----------



## Jim Wilde (Dec 20, 2018)

Victoria Bampton said:


> Then with the folders still selected, right-click on a folder and choose Remove to get rid of the empty folders.


The only issue with that could be the presence of an "Info.lua" file in each folder....so Removing from Lightroom will certainly clean up the Folders Panel, but if that file is there it won't physically delete the folder from the hard drive. In that case, the folders will still have to be deleted via Finder as well.


----------



## johnbeardy (Dec 20, 2018)

Jim Wilde said:


> The only issue with that could be the presence of an "Info.lua" file in each folder....so Removing from Lightroom will certainly clean up the Folders Panel, but if that file is there it won't physically delete the folder from the hard drive. In that case, the folders will still have to be deleted via Finder as well.



Of course, I have asked Adobe to let us delete folders when info.lua is the only file, and it is not rocket science. I use this little script.

John





```
--[[
Deletes info.lua files in selected folders

SETUP INSTRUCTIONS

Open the file in TextEdit and change the value myNewPrefix below
Temporarily save this file onto your desktop and call it "YOURFILENAME.lua".

Now you need to create a scripts folder:
    In Lightroom, choose Lightroom > Preferences (Mac OS) or Edit > Preferences (Windows).
    Choose the Preset tab and select Show Lightroom Presets folder.
    Create a folder in the Lightroom folder called Scripts.
    Copy the "YOURFILENAME.lua" script into the Scripts folder.
    Quit and reopen Lightroom.
You should now see a little scripts menu to the right of the Help menu. It has a single item Title case keywords.
--]]

if MAC_ENV then SEP = '/' else SEP = '\\' end

--[[
Don't change anything after here
--]]
LrView = import 'LrView'
LrDialogs = import 'LrDialogs'
LrApplication = import 'LrApplication'
catalog = LrApplication.activeCatalog()
LrTasks = import 'LrTasks'
LrFileUtils = import 'LrFileUtils'
LrFunctionContext = import 'LrFunctionContext'

if LrApplication.versionTable()['major'] <5 then
    LrDialogs.message( "Oops - must be run in Lr5 or later" , "collection:getSearchDescription() is a feature introduced in Lr5")
    else
    
    LrTasks.startAsyncTask( function()   
    catalog:withWriteAccessDo( "Duplicate smart collections", function()
        folders = catalog:getActiveSources( )
        for i, folder in ipairs(folders) do               
            if folder:getPath() ~= nil then
            path = folder:getPath() .. SEP .. 'info.lua'           
            if LrFileUtils.exists(path) == 'file' then
                LrFileUtils.delete( path )
                end
            end
        end
        LrDialogs.showBezel( "Now try deleting the folders in Lr")
    end)
    end)
end
```


----------



## Juju (Dec 20, 2018)

Many thanks guys for the suggestions.  Few clarifications from me:
1) So it's ok to delete all DNG files from the folder and also catalog?  Can I do a search by file type DNG and delete ALL DNG files from my catalog?  Do I even need DNG files anyway?
2) This process of syncing has added more than 20,000 DNG files to my catalog and probably many hundreds or thousands of folders.  It will be very painful to even select them to delete.  Is it harmful to leave them there?  Will it affect future syncing process or anything at all?
3)  What are info.lua files and why do I need them at all?


----------



## Cyndi25 (Feb 8, 2019)

johnbeardy said:


> Of course, I have asked Adobe to let us delete folders when info.lua is the only file, and it is not rocket science. I use this little script.
> 
> John
> 
> ...



I get an error.


----------



## johnbeardy (Feb 8, 2019)

You've probably not copied the script correctly. Make sure you do have the -- at the start .


----------

