~xibo-maintainers/xibo/release22

« back to all changes in this revision

Viewing changes to lib/XTR/ImageProcessingTask.php

  • Committer: GitHub
  • Author(s): Dan Garner
  • Date: 2019-12-02 14:15:22 UTC
  • mfrom: (717.1.4)
  • Revision ID: git-v1:651152cc0b54813b00dcb76e5d442f6d01ae5507
Merge pull request #736 from ifarzana/feature/Bugfix2.2.1

Bugfix2.2.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
71
71
 
72
72
        $libraryLocation = $this->config->getSetting('LIBRARY_LOCATION');
73
73
        $resizeThreshold = $this->config->getSetting('DEFAULT_RESIZE_THRESHOLD');
 
74
        $count = 0;
74
75
 
75
76
        // Get list of Images
76
77
        foreach ($images as $media) {
85
86
                $this->imageProcessingService->resizeImage($filePath, null, $resizeThreshold);
86
87
            }
87
88
 
 
89
            // Clears file status cache
 
90
            clearstatcache(true, $filePath);
 
91
 
 
92
            $count++;
 
93
 
88
94
            // Release image and save
89
 
            // Work out the MD5
90
 
            $media->md5 = md5_file($libraryLocation . $media->storedAs);
91
 
            $media->released = 1;
 
95
            $media->release(md5_file($filePath), filesize($filePath));
 
96
            $this->store->commitIfNecessary();
92
97
 
93
 
            try {
94
 
                $media->save();
95
 
            } catch (\Exception $error) {
96
 
                $this->log->error($error);
97
 
            }
98
98
        }
 
99
 
 
100
        $this->appendRunMessage('Released and modified image count. ' . $count);
 
101
 
99
102
    }
100
103
}
 
 
b'\\ No newline at end of file'