diff -Nru -x '.*' -x '*.js' -x '*.css' shimmie2-cfad6087ab9c7abc73fc79efc12c2b43e981ec6d/core/extension.class.php booru/core/extension.class.php --- shimmie2-cfad6087ab9c7abc73fc79efc12c2b43e981ec6d/core/extension.class.php 2016-01-25 11:16:25.000000000 +0000 +++ booru/core/extension.class.php 2016-03-17 21:02:33.525225133 +0000 @@ -205,7 +205,7 @@ // even more hax.. $event->metadata['tags'] = $existing->get_tag_list(); - $image = $this->create_image_from_data(warehouse_path("images", $event->metadata['hash']), $event->metadata); + $image = $this->create_image_from_data(warehouse_path("images", $event->metadata['hash'].'.'.$event->type), $event->metadata); if(is_null($image)) { throw new UploadException("Data handler failed to create image object from data"); @@ -216,7 +216,7 @@ $event->image_id = $image_id; } else { - $image = $this->create_image_from_data(warehouse_path("images", $event->hash), $event->metadata); + $image = $this->create_image_from_data(warehouse_path("images", $event->hash.'.'.$event->type), $event->metadata); if(is_null($image)) { throw new UploadException("Data handler failed to create image object from data"); } @@ -248,10 +248,10 @@ public function onThumbnailGeneration(ThumbnailGenerationEvent $event) { if($this->supported_ext($event->type)) { if (method_exists($this, 'create_thumb_force') && $event->force == true) { - $this->create_thumb_force($event->hash); + $this->create_thumb_force($event->hash, $event->type); } else { - $this->create_thumb($event->hash); + $this->create_thumb($event->hash, $event->type); } } } @@ -298,6 +298,6 @@ * @param string $hash * @return bool */ - abstract protected function create_thumb($hash); + abstract protected function create_thumb($hash, $type); } diff -Nru -x '.*' -x '*.js' -x '*.css' shimmie2-cfad6087ab9c7abc73fc79efc12c2b43e981ec6d/core/imageboard.pack.php booru/core/imageboard.pack.php --- shimmie2-cfad6087ab9c7abc73fc79efc12c2b43e981ec6d/core/imageboard.pack.php 2016-01-25 11:16:25.000000000 +0000 +++ booru/core/imageboard.pack.php 2016-03-17 21:18:25.986270550 +0000 @@ -466,7 +466,7 @@ * @return string */ public function get_image_filename() { - return warehouse_path("images", $this->hash); + return warehouse_path("images", $this->hash.".".$this->ext); } /** @@ -475,7 +475,7 @@ * @return string */ public function get_thumb_filename() { - return warehouse_path("thumbs", $this->hash); + return warehouse_path("thumbs", $this->hash.".jpg"); } /** @@ -1306,7 +1306,7 @@ * @throws UploadException */ function move_upload_to_archive(DataUploadEvent $event) { - $target = warehouse_path("images", $event->hash); + $target = warehouse_path("images", $event->hash.".".$event->type); if(!@copy($event->tmpname, $target)) { $errors = error_get_last(); // note: requires php 5.2 throw new UploadException("Failed to copy file from uploads ({$event->tmpname}) to archive ($target): {$errors['type']} / {$errors['message']}"); diff -Nru -x '.*' -x '*.js' -x '*.css' shimmie2-cfad6087ab9c7abc73fc79efc12c2b43e981ec6d/ext/admin/main.php booru/ext/admin/main.php --- shimmie2-cfad6087ab9c7abc73fc79efc12c2b43e981ec6d/ext/admin/main.php 2016-01-25 11:16:25.000000000 +0000 +++ booru/ext/admin/main.php 2016-03-17 21:08:32.168242235 +0000 @@ -218,7 +218,7 @@ $zip = new ZipArchive; if($zip->open($filename, ZIPARCHIVE::CREATE | ZIPARCHIVE::OVERWRITE) === TRUE){ foreach($images as $img){ - $img_loc = warehouse_path("images", $img["hash"], FALSE); + $img_loc = warehouse_path("images", $img["hash"].".".$img["ext"], FALSE); $zip->addFile($img_loc, $img["hash"].".".$img["ext"]); } $zip->close(); diff -Nru -x '.*' -x '*.js' -x '*.css' shimmie2-cfad6087ab9c7abc73fc79efc12c2b43e981ec6d/ext/amazon_s3/main.php booru/ext/amazon_s3/main.php --- shimmie2-cfad6087ab9c7abc73fc79efc12c2b43e981ec6d/ext/amazon_s3/main.php 2016-01-25 11:16:25.000000000 +0000 +++ booru/ext/amazon_s3/main.php 2016-03-17 21:17:51.665268914 +0000 @@ -35,7 +35,7 @@ $s3 = new S3($access, $secret); $s3->putBucket($bucket, S3::ACL_PUBLIC_READ); $s3->putObjectFile( - warehouse_path("thumbs", $event->image->hash), + warehouse_path("thumbs", $event->image->hash.".jpg"), $bucket, 'thumbs/'.$event->image->hash, S3::ACL_PUBLIC_READ, @@ -46,7 +46,7 @@ ) ); $s3->putObjectFile( - warehouse_path("images", $event->image->hash), + warehouse_path("images", $event->image->hash.".".$event->image->ext), $bucket, 'images/'.$event->image->hash, S3::ACL_PUBLIC_READ, diff -Nru -x '.*' -x '*.js' -x '*.css' shimmie2-cfad6087ab9c7abc73fc79efc12c2b43e981ec6d/ext/bulk_add_csv/main.php booru/ext/bulk_add_csv/main.php --- shimmie2-cfad6087ab9c7abc73fc79efc12c2b43e981ec6d/ext/bulk_add_csv/main.php 2016-01-25 11:16:25.000000000 +0000 +++ booru/ext/bulk_add_csv/main.php 2016-03-17 21:18:54.216271896 +0000 @@ -85,7 +85,7 @@ send_event($ratingevent); } if (file_exists($thumbfile)) { - copy($thumbfile, warehouse_path("thumbs", $event->hash)); + copy($thumbfile, warehouse_path("thumbs", $event->hash.".jpg")); } } } diff -Nru -x '.*' -x '*.js' -x '*.css' shimmie2-cfad6087ab9c7abc73fc79efc12c2b43e981ec6d/ext/handle_flash/main.php booru/ext/handle_flash/main.php --- shimmie2-cfad6087ab9c7abc73fc79efc12c2b43e981ec6d/ext/handle_flash/main.php 2016-01-25 11:16:25.000000000 +0000 +++ booru/ext/handle_flash/main.php 2016-03-17 21:04:30.725230722 +0000 @@ -11,8 +11,8 @@ * @param string $hash * @return bool */ - protected function create_thumb($hash) { - copy("ext/handle_flash/thumb.jpg", warehouse_path("thumbs", $hash)); + protected function create_thumb($hash, $type) { + copy("ext/handle_flash/thumb.jpg", warehouse_path("thumbs", $hash.".jpg")); return true; } diff -Nru -x '.*' -x '*.js' -x '*.css' shimmie2-cfad6087ab9c7abc73fc79efc12c2b43e981ec6d/ext/handle_ico/main.php booru/ext/handle_ico/main.php --- shimmie2-cfad6087ab9c7abc73fc79efc12c2b43e981ec6d/ext/handle_ico/main.php 2016-01-25 11:16:25.000000000 +0000 +++ booru/ext/handle_ico/main.php 2016-03-17 21:05:44.926234260 +0000 @@ -12,7 +12,7 @@ $ha = substr($hash, 0, 2); if(!move_upload_to_archive($event)) return; send_event(new ThumbnailGenerationEvent($event->hash, $event->type)); - $image = $this->create_image_from_data("images/$ha/$hash", $event->metadata); + $image = $this->create_image_from_data("images/$ha/$hash.".$event->type, $event->metadata); if(is_null($image)) { throw new UploadException("Icon handler failed to create image object from data"); } @@ -101,11 +101,11 @@ * @param $hash * @return bool */ - private function create_thumb($hash) { + private function create_thumb($hash, $type) { global $config; - $inname = warehouse_path("images", $hash); - $outname = warehouse_path("thumbs", $hash); + $inname = warehouse_path("images", $hash.".".$type); + $outname = warehouse_path("thumbs", $hash.".jpg"); $w = $config->get_int("thumb_width"); $h = $config->get_int("thumb_height"); diff -Nru -x '.*' -x '*.js' -x '*.css' shimmie2-cfad6087ab9c7abc73fc79efc12c2b43e981ec6d/ext/handle_mp3/main.php booru/ext/handle_mp3/main.php --- shimmie2-cfad6087ab9c7abc73fc79efc12c2b43e981ec6d/ext/handle_mp3/main.php 2016-01-25 11:16:25.000000000 +0000 +++ booru/ext/handle_mp3/main.php 2016-03-17 21:06:17.499235813 +0000 @@ -11,7 +11,7 @@ * @return bool */ protected function create_thumb($hash) { - copy("ext/handle_mp3/thumb.jpg", warehouse_path("thumbs", $hash)); + copy("ext/handle_mp3/thumb.jpg", warehouse_path("thumbs", $hash.".jpg")); return true; } diff -Nru -x '.*' -x '*.js' -x '*.css' shimmie2-cfad6087ab9c7abc73fc79efc12c2b43e981ec6d/ext/handle_pixel/main.php booru/ext/handle_pixel/main.php --- shimmie2-cfad6087ab9c7abc73fc79efc12c2b43e981ec6d/ext/handle_pixel/main.php 2016-01-25 11:16:25.000000000 +0000 +++ booru/ext/handle_pixel/main.php 2016-03-17 21:46:32.204350955 +0000 @@ -58,23 +58,23 @@ * @param string $hash * @return bool */ - protected function create_thumb(/*string*/ $hash) { - $outname = warehouse_path("thumbs", $hash); + protected function create_thumb(/*string*/ $hash, /*string*/ $type) { + $outname = warehouse_path("thumbs", $hash.".jpg"); if(file_exists($outname)) { return true; } - return $this->create_thumb_force($hash); + return $this->create_thumb_force($hash, $type); } /** * @param string $hash * @return bool */ - protected function create_thumb_force(/*string*/ $hash) { + protected function create_thumb_force(/*string*/ $hash, /*string*/ $type) { global $config; - $inname = warehouse_path("images", $hash); - $outname = warehouse_path("thumbs", $hash); + $inname = warehouse_path("images", $hash.".".$type); + $outname = warehouse_path("thumbs", $hash.".jpg"); $ok = false; diff -Nru -x '.*' -x '*.js' -x '*.css' shimmie2-cfad6087ab9c7abc73fc79efc12c2b43e981ec6d/ext/handle_svg/main.php booru/ext/handle_svg/main.php --- shimmie2-cfad6087ab9c7abc73fc79efc12c2b43e981ec6d/ext/handle_svg/main.php 2016-01-25 11:16:25.000000000 +0000 +++ booru/ext/handle_svg/main.php 2016-03-17 21:20:30.350276480 +0000 @@ -12,7 +12,7 @@ $hash = $event->hash; if(!move_upload_to_archive($event)) return; send_event(new ThumbnailGenerationEvent($event->hash, $event->type)); - $image = $this->create_image_from_data(warehouse_path("images", $hash), $event->metadata); + $image = $this->create_image_from_data(warehouse_path("images", $hash.".".$event->type), $event->metadata); if(is_null($image)) { throw new UploadException("SVG handler failed to create image object from data"); } @@ -26,7 +26,7 @@ if($this->supported_ext($event->type)) { $hash = $event->hash; - copy("ext/handle_svg/thumb.jpg", warehouse_path("thumbs", $hash)); + copy("ext/handle_svg/thumb.jpg", warehouse_path("thumbs", $hash.".jpg")); } } @@ -46,7 +46,7 @@ $page->set_type("image/svg+xml"); $page->set_mode("data"); - $page->set_data(file_get_contents(warehouse_path("images", $hash))); + $page->set_data(file_get_contents(warehouse_path("images", $hash.".".$image->ext))); } } diff -Nru -x '.*' -x '*.js' -x '*.css' shimmie2-cfad6087ab9c7abc73fc79efc12c2b43e981ec6d/ext/handle_video/main.php booru/ext/handle_video/main.php --- shimmie2-cfad6087ab9c7abc73fc79efc12c2b43e981ec6d/ext/handle_video/main.php 2016-01-25 11:16:25.000000000 +0000 +++ booru/ext/handle_video/main.php 2016-03-17 21:07:18.733238733 +0000 @@ -61,7 +61,7 @@ * @param string $hash * @return bool Returns true on successful thumbnail creation. */ - protected function create_thumb($hash) { + protected function create_thumb($hash, $type) { global $config; $ok = false; @@ -70,7 +70,7 @@ { default: case 'static': - $outname = warehouse_path("thumbs", $hash); + $outname = warehouse_path("thumbs", $hash.".jpg"); copy("ext/handle_video/thumb.jpg", $outname); $ok = true; break; @@ -80,8 +80,8 @@ $w = (int)$config->get_int("thumb_width"); $h = (int)$config->get_int("thumb_height"); - $inname = escapeshellarg(warehouse_path("images", $hash)); - $outname = escapeshellarg(warehouse_path("thumbs", $hash)); + $inname = escapeshellarg(warehouse_path("images", $hash.".".$type)); + $outname = escapeshellarg(warehouse_path("thumbs", $hash.".jpg")); if ($config->get_bool("video_thumb_ignore_aspect_ratio") == true) { diff -Nru -x '.*' -x '*.js' -x '*.css' shimmie2-cfad6087ab9c7abc73fc79efc12c2b43e981ec6d/ext/resize/main.php booru/ext/resize/main.php --- shimmie2-cfad6087ab9c7abc73fc79efc12c2b43e981ec6d/ext/resize/main.php 2016-01-25 11:16:25.000000000 +0000 +++ booru/ext/resize/main.php 2016-03-17 21:16:39.704265482 +0000 @@ -74,7 +74,7 @@ } $isanigif = 0; if($image_obj->ext == "gif"){ - $image_filename = warehouse_path("images", $image_obj->hash); + $image_filename = warehouse_path("images", $image_obj->hash.".".$image_obj->ext); if(($fh = @fopen($image_filename, 'rb'))) { //check if gif is animated (via http://www.php.net/manual/en/function.imagecreatefromgif.php#104473) while(!feof($fh) && $isanigif < 2) { @@ -171,7 +171,7 @@ } $hash = $image_obj->hash; - $image_filename = warehouse_path("images", $hash); + $image_filename = warehouse_path("images", $hash.".".$image_obj->ext); $info = getimagesize($image_filename); /* Get the image file type */ $pathinfo = pathinfo($image_obj->filename); @@ -250,7 +250,7 @@ /* Move the new image into the main storage location */ $new_hash = md5_file($tmp_filename); $new_size = filesize($tmp_filename); - $target = warehouse_path("images", $new_hash); + $target = warehouse_path("images", $new_hash.".".$image_obj->ext); if(!@copy($tmp_filename, $target)) { throw new ImageResizeException("Failed to copy new image file from temporary location ({$tmp_filename}) to archive ($target)"); } diff -Nru -x '.*' -x '*.js' -x '*.css' shimmie2-cfad6087ab9c7abc73fc79efc12c2b43e981ec6d/ext/rotate/main.php booru/ext/rotate/main.php --- shimmie2-cfad6087ab9c7abc73fc79efc12c2b43e981ec6d/ext/rotate/main.php 2016-01-25 11:16:25.000000000 +0000 +++ booru/ext/rotate/main.php 2016-03-17 21:17:15.913267209 +0000 @@ -126,7 +126,7 @@ throw new ImageRotateException("Image does not have a hash associated with it."); } - $image_filename = warehouse_path("images", $hash); + $image_filename = warehouse_path("images", $hash.".".$image_obj->ext); if (file_exists ( $image_filename )==false) { throw new ImageRotateException("$image_filename does not exist."); } $info = getimagesize($image_filename); /* Get the image file type */ @@ -204,7 +204,7 @@ /* Move the new image into the main storage location */ $new_hash = md5_file($tmp_filename); $new_size = filesize($tmp_filename); - $target = warehouse_path("images", $new_hash); + $target = warehouse_path("images", $new_hash.".".$image_obj->ext); if(!@copy($tmp_filename, $target)) { throw new ImageRotateException("Failed to copy new image file from temporary location ({$tmp_filename}) to archive ($target)"); }