Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #4037

    I’ve been using the Avisio theme for awhile now and made a fair amount of customizations… which has been my first foray into WP. So please forgive me if I ask a question that has already been answered here… or something that should be obvious. I’ve found a few threads on this topic… one was unanswered… the other turned to German so I’m not sure if it was answered or not. :o)

    When uploading the Featured Image (940×440, 2.14:1 Aspect Ratio)… a custom Avisio thumbnail is made (70×50, 1.4:1 Aspect Ratio). Because of the differing aspect ratios of the images, the thumbnail is cropped out of the exact middle of the image. This doesn’t always leave you with the best thumbnail.

    WP has seemingly overcome this issue with their Media -> Edit Image area that allows you to crop and resize the different images after they have been uploaded. They even have the option to only adjust the WP thumbnail size image (150×150) after editing. The final output of this edit is a file in the same location as the previous thumb with a randomly generated key injected into the name… and this is where I assume… that this new file path is stored somewhere in the WP database. ???

    So my questions (based on my assumptions) are these:

    Is Avisio even using the DB to store image locations? Or is it using String manipulation to create file paths out of the base image path?

    If it is using the DB, would it be possible to write code to have WP target the 70×50 sized thumbnail, rather than the 150×150 thumbnail, from the WP image editor?

    If none of the above… are there any other WP Admin panel type solutions for cropping/replacing the 70×50 sized thumbnail? (Not using manual crop and FTP)

    #44684

    After finishing this post… another option came to mind… please tell me if this is more “doable”.

    Avisio Large Image: 940×440 Aspect Ratio: 2.14:1

    Avisio Thumbnail: 70×50 Aspect Ratio: 1.4:1

    Inside the WP image editor you can crop the thumbnail to anything you want… if you uploaded a 940×440 sized image you can now quickly make a crop of the thumbnail inside WP.

    WP Crop: 616×440 Aspect Ratio: 1.4:1

    Giving you:

    WP Cropped Thumb: 150×107 Aspect Ratio: 1.4:1

    Questions:

    Can you get WP to size off of 70px on the longest edge? To deliver a 70×50 thumb?

    Can you then get the Avisio theme to use the edited WP thumb in place of the Avisio “centered” thumb?

    Thanks to anyone who actually made it through all of this. I really appreciate it!

    #44685

    Hey,

    have you tried to adjust the dimensions in function.php to your needs?

    $k_option['custom']['imgSize']['base'] = array('width'=>267, 'height'=>180); 	// backend preview size, if changed does not affect the frontend
    $k_option['custom']['imgSize']['S'] = array('width'=>70, 'height'=>50); // small preview pics eg sidebar news
    $k_option['custom']['imgSize']['M'] = array('width'=>192, 'height'=>130); // medium preview pic for portfolio with 4 columns
    $k_option['custom']['imgSize']['M3'] = array('width'=>274, 'height'=>170); // medium preview pic for portfolio with 3 columns
    $k_option['custom']['imgSize']['M2'] = array('width'=>436, 'height'=>230); // medium preview pic for portfolio with 2 columns
    $k_option['custom']['imgSize']['L'] = array('width'=>574, 'height'=>268); // image for blog posts and 1 column portfolio
    $k_option['custom']['imgSize']['XL'] = array('width'=>940, 'height'=>440); // big images for fullsize pages and mainpage slider

    Yes Avisio uses the db to store and query the image information and image locations. Maybe you need to regenerate your thumbnails after you changed the dimensions – you can use this plugin: http://wordpress.org/extend/plugins/regenerate-thumbnails/

    #44686

    Thanks for the reply… and the plugin. I was able to use the plugin and it worked perfectly for what I needed. The actual fix was a bit more complex so I’ll post it here for anyone who might come across this thread.

    To start… inside the WP admin find the Settings -> Media tab. Set the thumbnail size to match the Avisio theme. 70×50

    Now you need the plugin mentioned above to resize all of your previous “featured images” that need a new thumbnail of the appropriate size. The plugin allows for doing everything in your media library or just one by one.

    Next comes the code changing… I was actually able to dig through the Avisio code to figure this out… so you should be able to find these relatively easy enough.

    Inside index.php:

    Replace: $slideshow->setSlideshowSize(‘S’);

    With: $slideshow->setSlideshowSize(‘thumbnail’);

    Inside sidebar_news.php:

    Replace: $small_prev = kriesi_post_thumb($post->ID, array(‘size’=> array(‘S’),

    With: $small_prev = kriesi_post_thumb($post->ID, array(‘size’=> array(‘thumbnail’),

    I had a couple other places where I had created thumb images… and did a similar replace of ‘S’ with ‘thumbnail’.

    The beauty of this… is that the thumbs are now pulled from WP’s standard thumb and not the Avisio custom ‘S’ image. Which means I can now manipulate the thumbnails using the built in WP image editor to make changes to images that get cropped in a way that doesn’t look good.

    Hope this helps someone else someday. :o)

    #44687

    Thanks for providing your solution – I’m sure it will help others.

    #44688

    I wanted to thank both of you.

    Thanks to this post I was able to change the thumbnail size of my site: http://www.autonocion.com (it’s the newscast theme tho).

    I like it a lot more this way :)

    Thanks!!

    Regards.

    #44689

    Glad that the we could help you :)

    #44690

    Thanks a lot, its helped me to change Thumbnail sizes for Newscast wordpress theme (small preview pics for half sized posts and sidebar news) Its so easy!!!

    #44691

    Great! A truly beneficial post that keeps on helping !

    Thanks Nick

Viewing 9 posts - 1 through 9 (of 9 total)

The topic ‘Custom Crop 70×50 Thumbnail’ is closed to new replies.