*
* @return - target file name
*/
- function getStoreName()
+ function getStoreName($alt = false)
{
$opts = HTML_FlexyFramework::get()->Pman;
$fn = preg_replace('/[^a-z0-9_\.]+/i', '_', $this->filename);
+ if ($alt) {
+ $fn = preg_replace('/[^a-z0-9\.]+/i', '_', $this->filename);
+ }
return implode( '/', array(
$opts['storedir'], '_images_', date('Y/m', strtotime($this->created)), $this->id . '-'. $fn
));
*/
function toFileConvert()
{
+ $fn = $this->getStoreName();
+ if (!file_exists($fn)) {
+ $fn = $this->getStoreName(true);
+ }
+
require_once 'File/Convert.php';
$fc = new File_Convert($this->getStoreName(), $this->mimetype);
return $fc;
{
$this->sessionState(0); // turn off session... - locking...
require_once 'File/Convert.php';
- if (!file_exists($img->getStoreName())) {
+ if (!file_exists($img->getStoreName()) && !file_exists($img->getStoreName(true))) {
// print_r($img);exit;
header('Location: ' . $this->rootURL . '/Pman/templates/images/file-broken.png?reason=' .
urlencode("Original file was missing : " . $img->getStoreName()));