Previous Thread
Next Thread
Print Thread
Hop To
How to adjust image pixel dimensions for 6.7.1.1 #261060 01/25/2018 11:19 PM
Joined: Dec 2008
Posts: 34
Digitalgas Offline OP
Newbie
OP Offline
Newbie
Joined: Dec 2008
Posts: 34
I'm having trouble understanding the Attachment settings for "Image Resizing"
Do these settings only apply in Galleries? Not on attached images in forum posts?

User uploaded images into posts are coming through ImageMagick at the same pixel dimensions as they were submitted.
Example: "4,000px × 3,000px (scaled to 1,202px × 902px)"

If I could reduce pixel dimensions, I could set a higher % in Image Quality and still have an efficient file memory size.

What am I missing?

Re: How to adjust image pixel dimensions for 6.7.1.1 [Re: Digitalgas] #261061 01/26/2018 1:22 AM
Joined: Jun 2006
Posts: 15,852
Gizmo Offline
UBB.threads Developer
Offline
UBB.threads Developer
Joined: Jun 2006
Posts: 15,852
It would appear that there is a bug with ImageMagick, where it should resize before compression (like GD), but for whatever reason is not. Isaac mentioned that he'll have time this weekend to look further into the issue while I'm working on content rebuilder coding.


I am a Web Development Contractor, I do not work for UBBCentral. I have provided free User to User Support since the beginning of these support forums.
Need to Upgrade?
Forums: A Gardeners Forum Scouters World
UBB.threads: UBBWiki, UBB Styles, UBB.Sitemaps
Longtime Supporter & Resident Post-A-Holic
VNC Web Services: Code Modifications, Upgrades, Styling, Coding Services, Disaster Recovery, and more!
Re: How to adjust image pixel dimensions for 6.7.1.1 [Re: Digitalgas] #261063 01/26/2018 11:40 AM
Joined: Dec 2008
Posts: 34
Digitalgas Offline OP
Newbie
OP Offline
Newbie
Joined: Dec 2008
Posts: 34
I switched to the GD2 option in "Attachments" and now the pixel size is being reduced to the chosen settings. I'm able to get 800 pixel images at 80% compression and still get nice optimized file sizes.

Always thought ImageMagick did a little nicer optimization, so I hope the bug can be resolved.

Thanks!

Re: How to adjust image pixel dimensions for 6.7.1.1 [Re: Digitalgas] #261064 01/26/2018 3:33 PM
Joined: Jun 2006
Posts: 15,852
Gizmo Offline
UBB.threads Developer
Offline
UBB.threads Developer
Joined: Jun 2006
Posts: 15,852
Images processed through ImageMagick are always more crisp, its why we generally recommend it over GD; hopefully we can make the string sane again after testing.


I am a Web Development Contractor, I do not work for UBBCentral. I have provided free User to User Support since the beginning of these support forums.
Need to Upgrade?
Forums: A Gardeners Forum Scouters World
UBB.threads: UBBWiki, UBB Styles, UBB.Sitemaps
Longtime Supporter & Resident Post-A-Holic
VNC Web Services: Code Modifications, Upgrades, Styling, Coding Services, Disaster Recovery, and more!
Re: How to adjust image pixel dimensions for 6.7.1.1 [Re: Digitalgas] #261065 01/26/2018 7:21 PM
Joined: Apr 2004
Posts: 1,549
isaac Offline
UBB.threads Developer
Offline
UBB.threads Developer
Joined: Apr 2004
Posts: 1,549
I found the issue and created a quick patch that you can update the file on your own server with right now. Though, It is best to just wait until the next version of UBB.threads is out, since it will have a more detailed code block inserted. This code is only needed if you are using ImageMagick. GD2 does not require this attribute at all.

I've tested this with and without GD2. GD2 presents no visual errors, and still processes the images as intended -- Though, with the attribute added, GD2 may create an warning entry in the error log such as, "unrecognized command "-resize" but image was processed anyways." But I havent checked this. And thats only an assumption.


in forums/libs/image.inc.php

EDIT 2018-02-21:
IF YOU PREVIOUSLY MADE THE FOLLOWING CHANGE TO YOUR IMAGE.INC.PHP FILE, REVERT THE CHANGE OR GRAB A FRESH COPY OF THE FILE FROM THE ORIGINAL ZIP ARCHIVE. THEN SKIP THIS STRIKED-OUT SECTION, AND PROCEED TO THE "MAKE THIS CHANGE" SECTION


FIND (towards the end)
Code
	$exec = "\"{$config['CONVERT_PATH']}\" {$config['FULL_PATH']}/tmp/$sourcefile $thumb {$width}x{$height} $quality {$output}:\"{$config['FULL_PATH']}/tmp/$sourcefile.$type\" 2>&1";

REPLACE WITH
Code
	$exec = "\"{$config['CONVERT_PATH']}\" {$config['FULL_PATH']}/tmp/$sourcefile $thumb -resize {$width}x{$height} $quality {$output}:\"{$config['FULL_PATH']}/tmp/$sourcefile.$type\" 2>&1";


MAKE THIS CHANGE:

FIND (towards the end)
Code
	if ($type == "thumb" || $type == "medium") {
		$thumb = " -thumbnail ";
	} else {
		$thumb = "";
	}

REPLACE WITH
Code
	if ($type == "thumb" || $type == "medium") {
		$thumb = " -thumbnail ";
	} else {
		$thumb = " -resize ";
	}


The ImageMagick resizing issue seems to have been missing from the code long before I came on board with UBBCentral. So I guess its now finally squashed. Digitalgas, thanks for posting about it, to finally give it some needed attention!

Last edited by isaac; 02/21/2018 11:48 PM. Reason: fixed my fix.

Current developer of UBB.threads PHP Forum Software // 7.7.3 released!
isaac @ id242.com // my forum @ CelicaHobby.com
Re: How to adjust image pixel dimensions for 6.7.1.1 [Re: Digitalgas] #261066 01/26/2018 7:24 PM
Joined: Apr 2004
Posts: 1,549
isaac Offline
UBB.threads Developer
Offline
UBB.threads Developer
Joined: Apr 2004
Posts: 1,549
Graphics Library ImageMagick:
Image Max Width/Height: 1920px
Image Quality: 60%

CyanCode jpg image
5256 x 3509 - 7,201 KB [ORIGINAL]
1920 x 1281 - 525 KB [PROCESSED]

ForestHighway jpg image
500 x 750 - 76 KB [ORIGINAL]
500 x 750 - 36 KB [PROCESSED]

Attached Files CyanCode_5256x3509.jpgForestHighway_500x750.jpg

Current developer of UBB.threads PHP Forum Software // 7.7.3 released!
isaac @ id242.com // my forum @ CelicaHobby.com
Re: How to adjust image pixel dimensions for 6.7.1.1 [Re: Digitalgas] #261067 01/26/2018 7:26 PM
Joined: Apr 2004
Posts: 1,549
isaac Offline
UBB.threads Developer
Offline
UBB.threads Developer
Joined: Apr 2004
Posts: 1,549
Graphics Library GD2:
Image Max Width/Height: 1920px
Image Quality: 60%

CyanCode jpg image
5256 x 3509 - 7,201 KB [ORIGINAL]
1920 x 1281 - 350 KB [PROCESSED]

ForestHighway jpg image
500 x 750 - 76 KB [ORIGINAL]
500 x 750 - 38 KB [PROCESSED]

Attached Files CyanCode_5256x3509.jpgForestHighway_500x750.jpg

Current developer of UBB.threads PHP Forum Software // 7.7.3 released!
isaac @ id242.com // my forum @ CelicaHobby.com
Re: How to adjust image pixel dimensions for 6.7.1.1 [Re: Digitalgas] #261068 01/27/2018 12:02 AM
Joined: Dec 2008
Posts: 34
Digitalgas Offline OP
Newbie
OP Offline
Newbie
Joined: Dec 2008
Posts: 34
Thanks for the quick diagnosis and solution!

Re: How to adjust image pixel dimensions for 6.7.1.1 [Re: Digitalgas] #261128 02/11/2018 7:00 AM
Joined: Jun 2006
Posts: 683
Morgan Offline
Addict
Offline
Addict
Joined: Jun 2006
Posts: 683
I'm using 7.6.1.1 and host say they installed ImageMagick 7.0.7-22 Q16 x86_64 2018-02-10

Isaac, I must say this is wonderful news HOWEVER I have one issue

after testing several times this is my feedback.

It resizes and compresses as it should BUT when using the Gallery with the new (Isaacs) codestring it does not upload thumbnails or medium size images anymore
only the full size. see attachmens here

Link to the gallery posts are here
http://www.britbike.com/forums/ubbthreads.php/forums/32/1/britbike-gallery

link to the post with new code that did not work
http://www.britbike.com/forums/ubbthreads.php/galleries/725173

Do you have any ideas what it could be?
I cut out and pasted only the exact code that you wrote above

PS here is a link to the forum attachment that worked fine
http://www.britbike.com/forums/ubbt...-with-60-imagemagick-new-code#Post725175

attachments below:
Left thumbnail shows when using unedited code
middle shows when edited code is used
right image shows three images please read the header of each but the left broken as it shows no thumbnail

Attached Files Screen Shot 2018-02-11 at 12.43.23.jpgScreen Shot 2018-02-11 at 12.46.49.jpgScreen Shot 2018-02-11 at 12.47.43.jpg
Last edited by Morgan; 02/11/2018 8:39 AM.

Morgan Johansson
BritBike Forum
http://www.britbike.com/forums/ubbthreads.php
Re: How to adjust image pixel dimensions for 6.7.1.1 [Re: Digitalgas] #261130 02/11/2018 8:46 AM
Joined: Jun 2006
Posts: 683
Morgan Offline
Addict
Offline
Addict
Joined: Jun 2006
Posts: 683
Isaac, it look like this forum has same issue as i describe above
see here I uploaded a post yesterday and so did Gizmo
https://www.ubbcentral.com/forums/ubbthreads.php/forums/48/1/photo-gallery

Last edited by Morgan; 02/11/2018 8:47 AM.

Morgan Johansson
BritBike Forum
http://www.britbike.com/forums/ubbthreads.php
Re: How to adjust image pixel dimensions for 6.7.1.1 [Re: Digitalgas] #261131 02/11/2018 8:49 AM
Joined: Apr 2004
Posts: 1,549
isaac Offline
UBB.threads Developer
Offline
UBB.threads Developer
Joined: Apr 2004
Posts: 1,549
Thanks Morgan. I received your previous 4 posts relating to this issue. I don't plan on doing anything about it at 5:30am on Sunday morning. I'll look in to on Monday even, when I get home from work. Thank you for reporting this.


Current developer of UBB.threads PHP Forum Software // 7.7.3 released!
isaac @ id242.com // my forum @ CelicaHobby.com
Re: How to adjust image pixel dimensions for 6.7.1.1 [Re: Morgan] #261169 02/21/2018 11:57 PM
Joined: Apr 2004
Posts: 1,549
isaac Offline
UBB.threads Developer
Offline
UBB.threads Developer
Joined: Apr 2004
Posts: 1,549
Originally Posted by Morgan
Isaac, it look like this forum has same issue as i describe above
see here I uploaded a post yesterday and so did Gizmo
https://www.ubbcentral.com/forums/ubbthreads.php/forums/48/1/photo-gallery


Hey again Morgan. Sorry for the delay since my previous reply. Its been a busy week here. One that actually started late last weekend -- gah!

I finally had some time to review the code again. This time making further corrections to get everything working as expected.

I've updated my previous post to reflect those changes. It can be found at:
https://www.ubbcentral.com/forums/u...-pixel-dimensions-for-6-7-1-1#Post261065

Cheers laugh


Current developer of UBB.threads PHP Forum Software // 7.7.3 released!
isaac @ id242.com // my forum @ CelicaHobby.com
Re: How to adjust image pixel dimensions for 6.7.1.1 [Re: Digitalgas] #261175 02/22/2018 4:04 AM
Joined: Jun 2006
Posts: 683
Morgan Offline
Addict
Offline
Addict
Joined: Jun 2006
Posts: 683
Isaac, I did the change and it works thank you very much.

I noticed one other thing now as I tried to drag the photos to my image manager and it did not work. Only when I select the normal way not drag.
Tested to drag photos on UBBCentral it worked fine but not on my forum.
see attached image what showed after I tried to drag the photo.

I wonder what could cause this? Have I missed a setting?

Attached Files Screen Shot 2018-02-22 at 09.51.37.jpg

Morgan Johansson
BritBike Forum
http://www.britbike.com/forums/ubbthreads.php
Re: How to adjust image pixel dimensions for 6.7.1.1 [Re: Morgan] #261178 02/22/2018 10:02 AM
Joined: Apr 2004
Posts: 1,549
isaac Offline
UBB.threads Developer
Offline
UBB.threads Developer
Joined: Apr 2004
Posts: 1,549
Originally Posted by Morgan
I noticed one other thing now as I tried to drag the photos to my image manager and it did not work. Only when I select the normal way not drag.
Tested to drag photos on UBBCentral it worked fine but not on my forum.
see attached image what showed after I tried to drag the photo.

I wonder what could cause this? Have I missed a setting?


please use search smile and stay on topic

https://www.ubbcentral.com/forums/u...ag-drop-attachments-not-working-with-mac

or you could be missing files in your ubb_js directory. or you are using internet explorer 10, as the link above suggests.


Current developer of UBB.threads PHP Forum Software // 7.7.3 released!
isaac @ id242.com // my forum @ CelicaHobby.com
Re: How to adjust image pixel dimensions for 6.7.1.1 [Re: Digitalgas] #261182 02/22/2018 12:28 PM
Joined: Jun 2006
Posts: 683
Morgan Offline
Addict
Offline
Addict
Joined: Jun 2006
Posts: 683
Thank you smile


Morgan Johansson
BritBike Forum
http://www.britbike.com/forums/ubbthreads.php
Re: How to adjust image pixel dimensions for 6.7.1.1 [Re: Digitalgas] #261183 02/22/2018 1:27 PM
Joined: Apr 2004
Posts: 1,549
isaac Offline
UBB.threads Developer
Offline
UBB.threads Developer
Joined: Apr 2004
Posts: 1,549
@Morgan,

I sent you a PM with some links. Cheers laugh


Current developer of UBB.threads PHP Forum Software // 7.7.3 released!
isaac @ id242.com // my forum @ CelicaHobby.com

Forum Search
ShoutChat Box
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Recent Topics
Mobile app?
by Baldeagle - 12/06/2019 9:32 PM
How do you change Text Line spacing?
by jorb - 11/23/2019 12:14 AM
What happened to FAQ or Forum Help
by Ruben - 11/20/2019 11:58 AM
Search feature encountering an Error message
by jorb - 11/20/2019 12:06 AM
Followed List v7.7.2 Question
by Ruben - 11/12/2019 12:22 PM
Who's Online Now
0 registered members (), 57 guests, and 412 spiders.
Key: Admin, Global Mod, Mod
Random Gallery Image
Latest Gallery Images
Artistic structures
Artistic structures
by isaac, August 29
Stones
Stones
by isaac, August 19
Amusing Terain Scenics
Amusing Terain Scenics
by isaac, August 19
Sky places
Sky places
by isaac, August 19
Powered by UBB.threads™ PHP Forum Software 7.7.4
(Snapshot build 20191023)