Advertisement:

Author Topic: existing inline images need to be resized for display.  (Read 661 times)

Offline Ruben Rocha

  • Semi-Newbie
  • *
  • Posts: 42
existing inline images need to be resized for display.
« on: December 12, 2017, 05:11:36 PM »
Okay I imported ubb classic to smf 2.0.13.
I can't go to the current version till the server is upgraded.
My dilemma is they all imported as 
Code: [Select]
<img sr= "image file.jpg"width"XXX" height"XXX" alt=" XXX" />I have fixed most all of them in the database to
Code: [Select]
[img] image file.jpg [/img].

But some images display as a huge display size

I have set the inline image size in the smf control panel to like 640.And ran all the maintenance routines but they don't resize unless I manually pick one of 2 million posts and just open and close the topic and it will resize the image.
Is there a way to fix this on existing posts with a routine?
Did I say 2 million? Yes.

Everything I have read on converting states only net new posts are re-sized based on the setting in the smf control panel.

Offline Rock Lee

  • SMF Hero
  • ******
  • Posts: 1,632
  • Gender: Male
  • Digitalizando un nuevo mundo :D
    • BomberCode.Oficial on Facebook
    • RockLee-BC on GitHub
    • @Bomber_Code on Twitter
    • Bomber Code ~ La nueva era del conocimiento
Re: existing inline images need to be resized for display.
« Reply #1 on: December 13, 2017, 08:26:37 AM »
It's too large a quantity, I do not know how good it is ... but it's not proven nCode Image Resizer It can be an easy route to reach what you want


Regards!
¡Regresando como cual Fenix! ~ Bomber Code © 2018
Ayudas - Aportes - Tutoriales - Y mucho mas!!!

Online drewactual

  • Jr. Member
  • **
  • Posts: 250
    • College Football Fan Site CFB51
Re: existing inline images need to be resized for display.
« Reply #2 on: December 15, 2017, 08:47:29 AM »
do it with css...

the idea is to set a maximum width in a fixed absolute size in the img tag, but only for the posts display, right?

go to your theme's index.css and add this:

Code: [Select]

.post .inner img{
    max-width: 640px !important;  /*or what width you want to use*/
    height: auto; /*this keeps the proportion of the image in check*/
}


the above css assumes your posts container (divs) are the same as a 'out of the box' SMF, and haven't been modified.

Once you've done this, hold shift hit refresh (or f5) and the images, no matter when they were posted, should 'render' a max width of 640px (or whatever width you choose)- it DOES NOT change the actual size of the image, but it certainly controls the size rendered to the user... 
https://www.cfb51.com is a College Football Fan Site, Store, and Publisher, launched in July of 2017

Offline Ruben Rocha

  • Semi-Newbie
  • *
  • Posts: 42
Re: existing inline images need to be resized for display.
« Reply #3 on: December 15, 2017, 02:11:54 PM »
I think at this time CSS is my best option.
My desire was to allow the cp to determine the size for ease of use in lieu of editing the code due to future upgrades overwriting the mod. but css  at this point is probably my best choice.
Also if I decide to change the width to say 800 it would just be a change in the cp, instead of remembering how I changed it before.

Thank you.

Offline Ruben Rocha

  • Semi-Newbie
  • *
  • Posts: 42
Re: existing inline images need to be resized for display.
« Reply #4 on: December 15, 2017, 02:47:38 PM »
Does it matter where I insert it in the file?

Offline Gwenwyfar

  • Lead Customizer
  • Sophist Member
  • *
  • Posts: 1,205
  • Gender: Female
    • Gwenwyfar on GitHub
Re: existing inline images need to be resized for display.
« Reply #5 on: December 15, 2017, 04:12:29 PM »
The resize function in the admin area doesn't work very well, it is better to use css. You can add that code anywhere, but when in doubt you can add css at the end of the file to be sure :)

Offline Ruben Rocha

  • Semi-Newbie
  • *
  • Posts: 42
Re: existing inline images need to be resized for display.
« Reply #6 on: December 16, 2017, 12:29:43 PM »
Thank you again.

Offline Ruben Rocha

  • Semi-Newbie
  • *
  • Posts: 42
Re: existing inline images need to be resized for display.
« Reply #7 on: February 16, 2018, 03:58:01 PM »
This works for posts to view,
But the css tag is not recognized for the recent posts link,they show full size. Is there another css tag needed for recent posts?

Offline butch2k

  • Full Member
  • ***
  • Posts: 416
  • Gender: Male
    • @butch2k on Twitter
    • Planète Roliste
Re: existing inline images need to be resized for display.
« Reply #8 on: February 16, 2018, 04:13:15 PM »
Try this

Code: [Select]
.post .inner img,.core_posts .list_posts img{
    max-width: 640px !important;  /*or what width you want to use*/
    height: auto; /*this keeps the proportion of the image in check*/
}

Offline Ruben Rocha

  • Semi-Newbie
  • *
  • Posts: 42
Re: existing inline images need to be resized for display.
« Reply #9 on: February 16, 2018, 04:38:28 PM »
should that be in addition to the first css tag or a replacement?

Offline butch2k

  • Full Member
  • ***
  • Posts: 416
  • Gender: Male
    • @butch2k on Twitter
    • Planète Roliste
Re: existing inline images need to be resized for display.
« Reply #10 on: February 16, 2018, 05:11:12 PM »
Replacement.

Offline Ruben Rocha

  • Semi-Newbie
  • *
  • Posts: 42
Re: existing inline images need to be resized for display.
« Reply #11 on: February 18, 2018, 01:37:44 PM »
Try this

Code: [Select]
.post .inner img,.core_posts .list_posts img{
    max-width: 640px !important;  /*or what width you want to use*/
    height: auto; /*this keeps the proportion of the image in check*/
}
This did not apper to work on recent topics.
What I ended up doing is editing
bbc_img with size parameters
that appears to work.