Generating thumbnails for post listing
-
When I add “New App Post,” a few images were generated, such as artworkUrl512-element.png, artworkUrl512-featured.png, artworkUrl512-ios.png….. How can I have the system to generate thumbnails that can be used for category page, using the file name, such as artworkUrl512-55×55.png, artworkUrl512-75×75.png, artworkUrl512-150×150.png. These thumbnail are essential to increase my page loading speed. Thanks.
-
Do you mean as the Featured Image?
It’s not featured image. It’s the images that are needed for home or category pages. If you look at my website (http://appedreview.org/), you will notice that all images are thumbnails. I have to generate these thumbnail manually, otherwise, it will try to load big Featured images, such as http://appedreview.org/wp-content/uploads/appstoreassistant_cache/AppStore/378352300/artworkUrl512.png. This significantly slows down the loading speed of my website. I am hoping that your plugin will automatically generate these thumbnail automatically so that it will help the loading speed. Thanks.
Try using a link to one of these:
artworkUrl512-element.png artworkUrl512-featured.png artworkUrl512-ios.png artworkUrl512-list.png artworkUrl512-post.png artworkUrl512-widget.pngYou can adjust each one of their sizes under Visual -> Image Sizes.
Hi sealsystems,
I have the same issue as coreylee. Before upgrading this plugin to 6.4.2. I adapted the stylesheet to adapt the size of post images to a smaller size than the 1024px. But the fact the browser has to resize each image from 1024px to 80px on the category pages makes the pages load very slowly. In the upgrade 6.4.2. you can know add the App Icon in excerpt. When checking the path to these generated App Icons they look like http://a940.phobos.apple.com/us/r30/Purple4/v4/…
What is the code to get these App Icons? I would like to replace the original pat “…/appstoreassistant_cache/AppStore/32…” by the one used for the “App Icon in excerpt”.
I looked around in your code and could find following code<?php $post_id = ( null === $post_id ) ? get_the_ID() : $post_id; $post_thumbnail_id = get_post_thumbnail_id( $post_id ); do_action( 'begin_fetch_post_thumbnail_html', $post_id, $post_thumbnail_id, $size ); ?>Can you tell me how to get the App Icon from phobos.apple.com and not more from my cache please?
Apple only supplies the full size image via phobos.apple.com. In order to get the smaller image size you will need to enable caching. The caching system take the full size image from phobos.apple.com then resizes them according to the sizes that you specify and saves them in your folder.
Dear sealsystems,
Take a look at the screenshot (screenshot here) I made from the window “Information about the image”. You can clearly read that the image is not coming from any of my folders and that the image is resized from 57px×57px to 60px×60px.
This image is published in the excerpt when set as such in the settings. I would like to use this image for the category pages that displays 30 apps.That is telling me that Cacheing is off.
In order to generate some thumbnails that my website can use, I had to add some code to app-store-functions.php
$editor = wp_get_image_editor( $bestFilePath );
$newSize = 180;
$editor->resize( $newSize, $newSize, true );
$filename = $editor->generate_filename( ‘180×180’, CACHE_DIRECTORY .”AppStore/”. $appID . ‘/’, NULL );
$new_image_info = $editor->save($filename);That is telling me that Cacheing is off.
Caching settings in App Store settings are enabled. Do I have to enable somewhere else the caching?
Dear Coreylee,
In order to generate some thumbnails that my website can use, I had to add some code to app-store-functions.php
I added your code add the end of app-store-functions.php and when loading the page with apps on it I got following error message :
Fatal error: Call to undefined function wp_get_current_user() in /home3/ws/public_html/wp-includes/capabilities.php on line 1281.
I am running WordPress 3.6.1.If you look in the folder wp-content/uploads/appstoreassistant_cache/AppStore do you see a bunch of numbered folders? Do any of them have images stores in them?
Dear sealsystems,
Yes, each numbered folders contains .png .jpg and .jpeg images. The .png are mostly artworkUrl100.png, artwork512-xxx.png, artworkUrl60.png.
Point your style sheet to use those cached images instead. You can adjust the size for each type in the preferences.
Dear sealsystems,
Where to point style sheet to use those cached images?
I changed already in app-store-assistant/includes/app-store-functions.php the order of the to use images. This works already for the single post.function appStore_getBestIcon($appID) { //MODiFIED the image name extensions to fit smaller images to load in page $filename = false; $firstChoice = CACHE_DIRECTORY."AppStore/".$appID."/artworkUrl512.png"; $secondChoice = CACHE_DIRECTORY."AppStore/".$appID."/artworkUrl512-post.jpg"; $thirdChoice = CACHE_DIRECTORY."AppStore/".$appID."/artworkUrl512-list.png"; $fourthChoice = CACHE_DIRECTORY."AppStore/".$appID."/artworkUrl60.jpg"; $fifthChoice = CACHE_DIRECTORY."AppStore/".$appID."/artworkUrl512-featured.png"; $sixthChoice = CACHE_DIRECTORY."AppStore/".$appID."/artworkUrl100.png"; $lastChoice = dirname( plugin_basename( __FILE__ ) )."/images/CautionIcon.png";In the theme I use to display multiple posts the code in the archive.php is
<?php if (has_post_thumbnail()): ?> <?php the_post_thumbnail(array(80,80), array('class' => "alignleft") ) ?> <?php else: ?> <img src="<?php myabp_print_thumbnail_url(); ?>" height="80" width="80" alt="<?php echo $post->post_title; ?>" align="left" /> <?php endif ?>I guess this is the place I have to call the icon function of App Store Assistant. But which code to add in place of <?php myabp_print_thumbnail_url(); ?> ?
Thumbnail is the Featured Image. Try running the Utilities -> Add Featured Images function and that should make the thumbnail option work.
The topic ‘Generating thumbnails for post listing’ is closed to new replies.