AnsweredAssumed Answered

GetThumbnail to resize may not reclaim space

Question asked by ScottBleackley on Mar 14, 2018
Latest reply on Mar 15, 2018 by philmodjunk

I am tracking a problem where my database blows up in size over time as new records come in.

I have a container field that I reassign the original image to a smaller thumbnail of itself to reduce storage and upload times. While this works, I suspect that the space taken by the original image is not being reclaimed.

Any thoughts or suggestions are most welcome.

 

This is the calculation for the container

// If the content of the container is an image shrink without distortion so max dimension is 1920

// if it is not an image then return self. This would apply to audio, files and music

// if image has a largest dimension that is less than 1920 then just use image do not attempt to enlarge image.

 

 

If ( PatternCount  ( GetContainerAttribute ( Media;"filename" ) ; ".jpg" )   or

     PatternCount  ( GetContainerAttribute ( Media;"filename" ) ; ".png" )  or

     PatternCount  ( GetContainerAttribute ( Media;"filename" ) ; ".bmp" ) or

     PatternCount  ( GetContainerAttribute ( Media;"filename" ) ; ".gif" )    or

     PatternCount  ( GetContainerAttribute ( Media;"filename" ) ; ".tif" )

       ;

            GetThumbnail (

                                     Self ;

                                     If ( GetWidth ( Self ) <  1280 ; GetWidth ( Self ) ; 1280 ) ;

                                     If ( GetHeight ( Self ) <  1280 ; GetHeight ( Self ) ; 1280 )

                                   ) ;

              Self

    )

Outcomes