Bug Item icon

Status
Not open for further replies.

JoyFreak

Customer
When I upload an item icon, it cuts it off and does not upload the full image. Why is that?

It shouldn't really cut the image off and should fit it in size after being uploaded.
 
This is not something I am able to replicate. You can control the icon size via the settings.

This sounds like an issue with your chosen image processing library (GD or ImageMagick).
 
The whole thing is weird. I've tried every dimension. It affects all icons, especially the ones on the the list.
 
Any news on this? Waiting for a reply so I know what to do. Currently waiting to add these items and it's on halt because of this issue.
 
After testing this and inspecting the code, this is working as intended. The icons all need to be the same size, and the image uploader will resize and/or crop images to make them fit the specified dimensions. Your image is 192x120, which means the width will be cropped to fit 120 pixels.

If you add padding to your image so that it becomes 192x192, it will no longer be cropped, assuming your image dimensions are set to equal width/height.
 
After testing this and inspecting the code, this is working as intended. The icons all need to be the same size, and the image uploader will resize and/or crop images to make them fit the specified dimensions. Your image is 192x120, which means the width will be cropped to fit 120 pixels.

If you add padding to your image so that it becomes 192x192, it will no longer be cropped, assuming your image dimensions are set to equal width/height.
Why is that though? Is there not a way that doesn't require me to edit the image and rather just upload it without it cropping? If i were to upload the image as an avatar, it wouldn't crop? Shouldn't it be the same?
 
The reason why it's not the same is the fact that this add-on allows you to control both the width and the height of images.

When you specify both a maximum width and maximum height to XF's image processor, it will crop images if needed. Avatars specify only one maximum size, meaning XF's image processor will resize images until both dimensions fit the maximum size.

It was specifically requested to be allowed to specify both maximum width and maximum height, so I can't change that as it would break image processing for other users.
 
The reason why it's not the same is the fact that this add-on allows you to control both the width and the height of images.

When you specify both a maximum width and maximum height to XF's image processor, it will crop images if needed. Avatars specify only one maximum size, meaning XF's image processor will resize images until both dimensions fit the maximum size.

It was specifically requested to be allowed to specify both maximum width and maximum height, so I can't change that as it would break image processing for other users.
So there isn't a way for me other than editing the image itself?
 
It also seems like the 192x192 cannot be changed and it's the default dimensions for this add-on. Setting the "Maximum item icon dimensions" changes the icons dimensions across all places. No idea what to do in this case other than edit the image and add padding, which I'm gonna find very annoying if I have a lot of images I need to edit just to avoid cropping.
 
I think if it were me, I would have had them both, height and width set at auto, so it displays as is and set the dimensions via CSS, allowing us to set how big or small we want the icon, rather than fixating those values which then leads to cropping.
 
There's no need to change it then if it's going to break it for everybody. Can you tell me where to look so I can change it for myself? Thanks.
 
In the next version I've made an undocumented change:
Change: If the item icon height is not specified, resize only the width of the icon
In other words, leaving the "height" field blank when uploading icons will resize only the width.

This will break the front-end display, as it requires both width and height to be specified, but you can apply the "height" field once you're done uploading icons.
 
In the next version I've made an undocumented change:

In other words, leaving the "height" field blank when uploading icons will resize only the width.

This will break the front-end display, as it requires both width and height to be specified, but you can apply the "height" field once you're done uploading icons.
Ok. I will test this out and see how it works. I kind of get the idea but will need to see it for myself to understand it.
 
There's no ETA. If you want to edit the files earlier, open src/addons/DBTech/Shop/Service/Item/Icon.php and find $image->resizeAndCrop($targetWidth, $targetHeight); then replace with $image->resizeWidth($targetWidth); - you won't need to change the width/height settings by making that edit.
 
There's no ETA. If you want to edit the files earlier, open src/addons/DBTech/Shop/Service/Item/Icon.php and find $image->resizeAndCrop($targetWidth, $targetHeight); then replace with $image->resizeWidth($targetWidth); - you won't need to change the width/height settings by making that edit.
That worked perfectly. Thank you!
 
Now, I have to reupload all the images again from adding them previously, in case they've been slightly cropped as I didn't notice until this one image I uploaded, the hat.
 
Hello @JoyFreak,

We hope your ticket regarding DragonByte Shop has been addressed to your satisfaction. This ticket has now been scheduled to be closed.

If your ticket has not been resolved, you can reply to this thread at any point in the next 7 days in order to reopen the ticket, afterwards this thread will be closed.

Please do not reply to this thread if your ticket has been resolved.

Thank you.


- DragonByte Technologies, Ltd.
 
Status
Not open for further replies.

DragonByte Shop

XenForo 1.5.3+ XenForo 2.0.x XenForo 2.1.x XenForo 2.2.x
Seller
DragonByte Technologies
Release date
Last update
Total downloads
3,183
Customer rating
5.00 star(s) 3 ratings
Back
Top