Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Aiheen aloitti: EL34 - toukokuu 10, 2014, 08:50:54 AP

Otsikko: Setting maximum image size in pixels for upload
Kirjoitti: EL34 - toukokuu 10, 2014, 08:50:54 AP
I did a search but did not find exactly what I was looking for

I have set the max width and height of posted pictures to 1024 wide and 800 high in
» Administration Center » Features and Options » Layout

Then I tested it by attaching a 1600 x 900 .gif file and the file uploaded
When clicking on the thumbnail a new window opens up with the image displayed and that window is approx 1544 x 846 pixels
The image in that window has horizontal and vertical scroll bars
So the image is still displaying a larger pop up window than 1024 wide x 800 and the image in that pop up is still 1600 x 900

I am confused as to what the setting here are actual for?
» Administration Center » Features and Options » Layout >> max width and max height

I have already set the max upload attachment sizes in KB, but can I set max image upload height and width?

I would like to restrict uploaded images to 1024px wide if possible and displayed images to 1024px
Otsikko: Re: Setting maximum image size in pixels for upload
Kirjoitti: Illori - toukokuu 10, 2014, 12:02:10 IP
do you want to change the size of attachments or images embedded into a post?
Otsikko: Re: Setting maximum image size in pixels for upload
Kirjoitti: EL34 - toukokuu 10, 2014, 12:10:47 IP
Lainaado you want to change the size of attachments or images embedded into a post?

Both really

I would like to have a pixel size limit of 1024 width x 800 height on uploads to the server
and I would like that to be the max that can be viewed in messages.
Otsikko: Re: Setting maximum image size in pixels for upload
Kirjoitti: Illori - toukokuu 10, 2014, 01:31:54 IP
the layout page is for images embedded into a post, not for attachments. this also does not effect images already linked to in existing posts.

to change attachments look in the attachments section of the admin panel.
Otsikko: Re: Setting maximum image size in pixels for upload
Kirjoitti: Arantor - toukokuu 10, 2014, 01:38:30 IP
Except the setting can actually be used by both under some circumstances...
Otsikko: Re: Setting maximum image size in pixels for upload
Kirjoitti: EL34 - toukokuu 10, 2014, 02:15:30 IP
Yes thanks but the settings in

» Administration Center » Attachments and Avatars » Attachment Settings

are for attachment sizes in KB, not for image max pixel sizes.
You can my setting in that screen below

I want to limit the upload size in Pixels and limit the display size in post in pixels

Check out post #1 again please if you need more info
Otsikko: Re: Setting maximum image size in pixels for upload
Kirjoitti: radu81 - toukokuu 10, 2014, 02:48:14 IP
You can also use a mod to resize images http://custom.simplemachines.org/mods/index.php?mod=2206
it's working well wit smf 2.0.7
Otsikko: Re: Setting maximum image size in pixels for upload
Kirjoitti: EL34 - toukokuu 12, 2014, 07:10:05 AP
Thanks radu but reading the last few post from that mod leads me to believe it has been abandoned
I don't mind installing mods but if the author is not active I back away

I still have the question for post #1
LainaaI have set the max width and height of posted pictures to 1024 wide and 800 high in
» Administration Center » Features and Options » Layout
Then I tested it by attaching a 1600 x 900 .gif file and the file uploaded

So if I was able to upload the 1600 x 900 image and it displayed larger than the 1024 x 800 max I set, what is that setting for?
Otsikko: Re: Setting maximum image size in pixels for upload
Kirjoitti: airdave - lokakuu 01, 2019, 09:45:04 AP
I have this same question...and I have the same problem.

I have limited image size to 800px wide.
I think this is big enough to see whats going on, and still fits on everyone's screen!
It also helps limit file sizes in attachments.

But it doesn't seem to work.
I've got people posting embedded images (remote direct linked inline images)
and they appear at their original source size...1200px, 1400px wide.
I need these images auto resized.

Also, while I have limited Image size in the Attachment options (to 200kb each, 800kb max per post )
this still does not control the image size in pixels.
At low res, you could still add a 1600px image!)

Otsikko: Re: Setting maximum image size in pixels for upload
Kirjoitti: drewactual - lokakuu 01, 2019, 10:34:06 AP
Lainaus käyttäjältä: airdave - lokakuu 01, 2019, 09:45:04 AP
I have this same question...and I have the same problem.

I have limited image size to 800px wide.
I think this is big enough to see whats going on, and still fits on everyone's screen!
It also helps limit file sizes in attachments.

But it doesn't seem to work.
I've got people posting embedded images (remote direct linked inline images)
and they appear at their original source size...1200px, 1400px wide.
I need these images auto resized.

Also, while I have limited Image size in the Attachment options (to 200kb each, 800kb max per post )
this still does not control the image size in pixels.
At low res, you could still add a 1600px image!)



add to your themes css file, at the bottom:


.post img  {
               max-width: 800px; /*or the width you want to set as max*/
               height: auto;
      }


or if you want to dress it up even more (appearance) get jiggy with it:


.post img  {
               max-width: 800px; /*or the width you want to set as max*/
               height: auto;
               border: 1px solid #ccc;
               border-radius: .5em;
               box-shadow: 3px 6px #eee;
      }
Otsikko: Re: Setting maximum image size in pixels for upload
Kirjoitti: Antechinus - lokakuu 01, 2019, 03:34:09 IP
Even simpler:

.bbc_img {
    max-width: 95%;
    height: auto;
}


That will cover all images in posts, news, sigs, attachments, whatever.