Index: src/squeezeplay/share/applets/ImageViewer/ImageViewerApplet.lua =================================================================== --- src/squeezeplay/share/applets/ImageViewer/ImageViewerApplet.lua (revision 8665) +++ src/squeezeplay/share/applets/ImageViewer/ImageViewerApplet.lua (working copy) @@ -17,7 +17,7 @@ -- stuff we use -local ipairs, tostring = ipairs, tostring +local ipairs, tostring, collectgarbage = ipairs, tostring, collectgarbage local os = require("os") local oo = require("loop.simple") @@ -711,7 +711,6 @@ --no iconbar self.window:setShowFrameworkWidgets(false) - else if self.imageError == nil then self.imageError = tostring(self.imgSource:getErrorMessage()) @@ -734,7 +733,13 @@ end ) + log:debug("image rendering done") + + -- free memory as quickly as possible + -- resizing large images might have consumed a lot of it + collectgarbage("collect") + self.isRendering = false self.task:removeTask() end @@ -782,14 +787,6 @@ end }, { - text = self:string("IMAGE_VIEWER_ROTATION"), - sound = "WINDOWSHOW", - callback = function(event, menuItem) - self:defineRotation(menuItem) - return EVENT_CONSUME - end - }, - { text = self:string("IMAGE_VIEWER_ZOOM"), sound = "WINDOWSHOW", callback = function(event, menuItem) @@ -807,6 +804,17 @@ }, } + if System:hasDeviceRotation() then + table.insert(settingsMenu, 5, { + text = self:string("IMAGE_VIEWER_ROTATION"), + sound = "WINDOWSHOW", + callback = function(event, menuItem) + self:defineRotation(menuItem) + return EVENT_CONSUME + end + }) + end + -- no need for a source setting on baby - we don't have any choice if System:hasLocalStorage() then table.insert(settingsMenu, 1, {