";
}
- $result = $this->db->db_query($query_str);
+ if($result = $this->db->db_query($query_str)) {
- if($this->dbver < 9) {
- $result['uri'] = "file://". $result['directory_path'] ."/". $result['name'];
- }
+ $row = $this->db->db_fetch_object($result);
- return $this->db->db_fetch_object($result);
+ if($this->dbver < 9) {
+ $row['uri'] = "file://". $row['directory_path'] ."/". $row['name'];
+ }
+
+ return $row;
+
+ }
+
+ return null;
} // get_photo_details
$this->_debug("Image [". $idx ."] ". $this->shrink_text($this->parse_uri($details['uri'], 'filename'), 20) ." Thumbnails:");
+ $changes = false;
+
foreach($resolutions as $resolution) {
$thumb_sub_path = substr($file_md5, 0, 2);
$this->_debug(" ". $resolution ."px");
if(!$this->create_thumbnail($full_path, $thumb_path, $resolution))
$error = 1;
+
+ $changes = true;
}
/* if the file hasn't changed there is no need to regen the thumb */
elseif($file_md5 != $this->getMD5($idx) || $force) {
if(!$this->create_thumbnail($full_path, $thumb_path, $resolution))
$error = 1;
+ $changes = true;
}
}
+ if(!$changes) {
+ $this->_debug(" already exist");
+ }
+
/* set the new/changed MD5 sum for the current photo */
if(!$error) {
$this->setMD5($idx, $file_md5);