diff --git a/addons/Core/Core.inc b/addons/Core/Core.inc index adfab38..ed09760 100644 --- a/addons/Core/Core.inc +++ b/addons/Core/Core.inc @@ -140,7 +140,7 @@ class ComicPressAddonCore extends ComicPressAddon { /** * Show an archive comic. */ - function show_archive($override_post = null, $format = "") { + function show_archive($override_post = null, $format = "%s
") { $this->show_media($override_post, "display_archive", $format); } diff --git a/classes/ComicPress.inc b/classes/ComicPress.inc index 63dc3d4..d98b710 100644 --- a/classes/ComicPress.inc +++ b/classes/ComicPress.inc @@ -70,6 +70,19 @@ class ComicPress { add_action('wp_footer', array(&$this, 'announce_activated_helpers')); } } + + add_filter('intermediate_image_sizes', array(&$this, 'intermediate_image_sizes')); + + foreach (array('comic', 'rss', 'archive', 'mini') as $size) { + list($w, $h) = explode("x", $this->comicpress_options["${size}_dimensions"]); + update_option("${size}_size_w", $w); + update_option("${size}_size_h", $h); + update_option("${size}_crop", 0); + } + } + + function intermediate_image_sizes($sizes) { + return array_merge($sizes, array('comic', 'rss', 'archive', 'mini')); } function needs_storyline_nav() { diff --git a/classes/ComicPressComicPost.inc b/classes/ComicPressComicPost.inc index 6d27368..5e458c3 100644 --- a/classes/ComicPressComicPost.inc +++ b/classes/ComicPressComicPost.inc @@ -32,8 +32,15 @@ class ComicPressComicPost { if (get_post_meta($attachment_id, "comic_image_type", true) == $type) { $attachment = get_post($attachment_id); $title = (!empty($attachment->post_excerpt) ? $attachment->post_excerpt : $attachment->post_title); + + $url = wp_get_attachment_url($attachment->ID, ''); + $sizes = image_downsize($attachment->ID, $size_type); + if ($sizes) { + $url = $sizes[0]; + } + $output[] = apply_filters('comicpress_attached_image', - sprintf($format, $this->get_comic_img_tag(wp_get_attachment_url($attachment->ID, ''), $size_type, array('title' => $title))), + sprintf($format, $this->get_comic_img_tag($url, $size_type, array('title' => $title))), $attachment_id, $i++); $found = true;