Previous Thread
Next Thread
Print Thread
Hop To
Joined: Dec 2008
Posts: 42
Likes: 3
D
Newbie
Newbie
D Offline
Joined: Dec 2008
Posts: 42
Likes: 3
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?

Joined: Jun 2006
Posts: 16,292
Likes: 116
UBB.threads Developer
UBB.threads Developer
Joined: Jun 2006
Posts: 16,292
Likes: 116
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.
Do you need Forum Install or Upgrade Services?
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!
Joined: Dec 2008
Posts: 42
Likes: 3
D
Newbie
Newbie
D Offline
Joined: Dec 2008
Posts: 42
Likes: 3
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!

Joined: Jun 2006
Posts: 16,292
Likes: 116
UBB.threads Developer
UBB.threads Developer
Joined: Jun 2006
Posts: 16,292
Likes: 116
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.
Do you need Forum Install or Upgrade Services?
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!
Joined: Apr 2004
Posts: 1,945
Likes: 145
UBB.threads Developer
UBB.threads Developer
Joined: Apr 2004
Posts: 1,945
Likes: 145
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/22/2018 12:48 AM. Reason: fixed my fix.

Current developer of UBB.threads PHP Forum Software
Current Release: UBBT 7.7.5 // Preview: UBBT 8.0.0
isaac @ id242.com // my forum @ CelicaHobby.com
Joined: Apr 2004
Posts: 1,945
Likes: 145
UBB.threads Developer
UBB.threads Developer
Joined: Apr 2004
Posts: 1,945
Likes: 145
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]
Attachments
CyanCode_5256x3509.jpg ForestHighway_500x750.jpg


Current developer of UBB.threads PHP Forum Software
Current Release: UBBT 7.7.5 // Preview: UBBT 8.0.0
isaac @ id242.com // my forum @ CelicaHobby.com
Joined: Apr 2004
Posts: 1,945
Likes: 145
UBB.threads Developer
UBB.threads Developer
Joined: Apr 2004
Posts: 1,945
Likes: 145
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]
Attachments
CyanCode_5256x3509.jpg ForestHighway_500x750.jpg


Current developer of UBB.threads PHP Forum Software
Current Release: UBBT 7.7.5 // Preview: UBBT 8.0.0
isaac @ id242.com // my forum @ CelicaHobby.com
Joined: Dec 2008
Posts: 42
Likes: 3
D
Newbie
Newbie
D Offline
Joined: Dec 2008
Posts: 42
Likes: 3
Thanks for the quick diagnosis and solution!

Joined: Jun 2006
Posts: 987
Likes: 24
Old Hand
Old Hand
Joined: Jun 2006
Posts: 987
Likes: 24
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
Attachments
Screen Shot 2018-02-11 at 12.43.23.jpg Screen Shot 2018-02-11 at 12.46.49.jpg Screen Shot 2018-02-11 at 12.47.43.jpg

Last edited by Morgan; 02/11/2018 9:39 AM.

Morgan Johansson
BritBike Forum
https://www.britbike.com/forums/ubbthreads.php
Joined: Jun 2006
Posts: 987
Likes: 24
Old Hand
Old Hand
Joined: Jun 2006
Posts: 987
Likes: 24
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 9:47 AM.

Morgan Johansson
BritBike Forum
https://www.britbike.com/forums/ubbthreads.php
Joined: Apr 2004
Posts: 1,945
Likes: 145
UBB.threads Developer
UBB.threads Developer
Joined: Apr 2004
Posts: 1,945
Likes: 145
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
Current Release: UBBT 7.7.5 // Preview: UBBT 8.0.0
isaac @ id242.com // my forum @ CelicaHobby.com
Joined: Apr 2004
Posts: 1,945
Likes: 145
UBB.threads Developer
UBB.threads Developer
Joined: Apr 2004
Posts: 1,945
Likes: 145
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
Current Release: UBBT 7.7.5 // Preview: UBBT 8.0.0
isaac @ id242.com // my forum @ CelicaHobby.com
Joined: Jun 2006
Posts: 987
Likes: 24
Old Hand
Old Hand
Joined: Jun 2006
Posts: 987
Likes: 24
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?
Attachments
Screen Shot 2018-02-22 at 09.51.37.jpg


Morgan Johansson
BritBike Forum
https://www.britbike.com/forums/ubbthreads.php
Joined: Apr 2004
Posts: 1,945
Likes: 145
UBB.threads Developer
UBB.threads Developer
Joined: Apr 2004
Posts: 1,945
Likes: 145
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
Current Release: UBBT 7.7.5 // Preview: UBBT 8.0.0
isaac @ id242.com // my forum @ CelicaHobby.com
Joined: Jun 2006
Posts: 987
Likes: 24
Old Hand
Old Hand
Joined: Jun 2006
Posts: 987
Likes: 24
Thank you smile


Morgan Johansson
BritBike Forum
https://www.britbike.com/forums/ubbthreads.php
Joined: Apr 2004
Posts: 1,945
Likes: 145
UBB.threads Developer
UBB.threads Developer
Joined: Apr 2004
Posts: 1,945
Likes: 145
@Morgan,

I sent you a PM with some links. Cheers laugh


Current developer of UBB.threads PHP Forum Software
Current Release: UBBT 7.7.5 // Preview: UBBT 8.0.0
isaac @ id242.com // my forum @ CelicaHobby.com

Link Copied to Clipboard
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Recent Topics
spam issues
by ECNet - 03/19/2024 11:45 PM
Looking for a forum
by azr - 03/15/2024 11:26 PM
Editing Links in Post
by Outdoorking - 03/15/2024 9:31 AM
Question on barkrowler and the like
by Mors - 02/29/2024 6:51 PM
Member Permissions Help
by domspeak - 02/27/2024 6:31 PM
Who's Online Now
3 members (rootman, Gizmo, Nightcrawler), 562 guests, and 186 robots.
Key: Admin, Global Mod, Mod
Random Gallery Image
Latest Gallery Images
Los Angeles
Los Angeles
by isaac, August 6
3D Creations
3D Creations
by JAISP, December 30
Artistic structures
Artistic structures
by isaac, August 29
Stones
Stones
by isaac, August 19
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20230217)