Advertisement:

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

Offline Ruben Rocha

  • Newbie
  • *
  • Posts: 8
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

  • Sophist Member
  • *****
  • Posts: 1,211
  • 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 © 2017
Ayudas - Aportes - Tutoriales - Y mucho mas!!!

Offline drewactual

  • Jr. Member
  • **
  • Posts: 143
    • 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

  • Newbie
  • *
  • Posts: 8
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

  • Newbie
  • *
  • Posts: 8
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

  • Customizer
  • Sr. Member
  • *
  • Posts: 858
  • 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

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