1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Fixed Image Downloading?

Discussion in 'Media Gallery Resolved Bugs' started by AppleAndMango, Sep 20, 2015.

  1. AppleAndMango

    AppleAndMango Active Member

    For this image for example...


    If you open up the "Share Image:" link in a new tab or another browser the image downloads as an MP4 file? Not that the image should be downloading anyway, should it not just open the image?

    Is this a bug or misconfiguration?

  2. Mike

    Mike XenForo Developer Staff Member

    It's not actually an mp4. When I rename the downloaded file to .jpg, it displays correctly. I wonder if this was uploaded as an image with that extension? If so, I think we may need to check the contents vs the extension and normalize it. I'll move this to bugs for further investigation.
  3. AppleAndMango

    AppleAndMango Active Member

    How strange, definitely a .jpg and not an .mp4

    Any idea regarding the downloading too? I thought the "share image" link allows me to share just the image?
  4. AppleAndMango

    AppleAndMango Active Member

    Hmmm... Tried other images, they upload fine.

    I'm guessing... This may be because of the image resolution?
  5. Chris D

    Chris D XenForo Developer Staff Member

    The original image is deleted now. Ideally you should have kept it uploaded so we could take a closer look if necessary.

    To be clear, that was a media item which displayed as an image when viewing the URL, but downloaded as an MP4 file when the share link was shared?

    The situation as described is pretty much impossible.

    Allowed file types are separate between video and image uploads - to upload an MP4 as an image, you would need to specifically allow MP4 as an allowed image file type, which I am assuming didn't happen, because that would be odd.

    If you rename a JPG file to have an MP4 extension, the upload will fail because "The contents of the uploaded image do not match the file's extension"

    So, I'm not totally sure how this could happen.

    Do you have any add-ons that may affect the Gallery or attachment system? Have you ever made any manual database changes with Gallery tables or the attachment tables? Was the media imported from another gallery or uploaded directly into XFMG?
  6. AppleAndMango

    AppleAndMango Active Member

    Sorry, I thought I'd try re-uploading through a difference PC...

    Here's the same photo, https://veganforum.co.uk/media/20150919_163945666.145/

    and another https://veganforum.co.uk/media/20150913_121235932_ios.144/

    It seems to happen with panoramic photos only?

    I've done nothing to the photo I uploaded from my mobile, also no addons that to my knowledge mess around with media gallery.

    I'm more than happy to provide a test account for you to upload any panoramic photo...?

    I've just downloaded and uploaded this https://upload.wikimedia.org/wikipedia/commons/e/ea/Sydney_Harbour_Bridge_night.jpg

    Same result https://veganforum.co.uk/media/sydney_harbour_brid4e_ni4ht.148/

    As I mentioned above it's only happening with large images I don't know if the size of the actual photo or the resolution may be why this is happening?
  7. AppleAndMango

    AppleAndMango Active Member

    Yes basically.
  8. Chris D

    Chris D XenForo Developer Staff Member

    Uploading directly from mobile could be relevant, and the type of image... Still confusing, but I will see if I can reproduce this.

    Was the upload done via Safari or Chrome iOS?
  9. Chris D

    Chris D XenForo Developer Staff Member

    Well, that's interesting.

    I just uploaded a (rather poor) panoramic image I took last week from my iPhone 6 Plus using Safari. That downloads as an mp4g file...
  10. AppleAndMango

    AppleAndMango Active Member

    I've uploaded from Chrome on IOS and Chrome/Edge on Windows 10 same result.

    I take it that you've reproduced the same on this forum?
    Last edited: Sep 20, 2015
  11. Chris D

    Chris D XenForo Developer Staff Member

    Yes, here.

    I'm just trying it as a normal attachment now.

    EDIT: That works, though it doesn't get treated like an image.

    OK. We have a decent reproduction case so thanks for the report. I'll look at what code is causing this to go a bit crazy :)
    AppleAndMango likes this.
  12. AppleAndMango

    AppleAndMango Active Member

    No problem, happy to help :)
  13. Chris D

    Chris D XenForo Developer Staff Member

    This is fixed, now, thanks again.

    There was a bit of dodgy logic related to ascertaining whether a file is an image or a video. The code (wrongly) assumed that if the image couldn't be resized then it must be a video, hence it gets uploaded and treated as if it was a video. I've just refactored this a fair bit and this works better, now.
    AppleAndMango likes this.
  14. AppleAndMango

    AppleAndMango Active Member

    No problem :)

    Ahh brilliant! :D
  15. AppleAndMango

    AppleAndMango Active Member

  16. Mike

    Mike XenForo Developer Staff Member

    AppleAndMango and Chris D like this.
  17. AppleAndMango

    AppleAndMango Active Member

    I've adjusted the pixel amount, host seems to be able to handle the increase.

    Thanks again.
    Chris D likes this.

Share This Page