• Register
    • Help

    striker  0 Items
    Currently Supporting
    • Home
    • News
    • Forum
    • Wiki
    • Support
      • Manage Subscriptions
      • FAQ
      • Support For
        • VaultWiki 4.x Series
        • VaultWiki.org Site
    • What's New?
    • Buy Now
    • Manual
    • 
    • Support
    • VaultWiki 4.x Series
    • Bug
    • JPG images: Error while resizing: vw_attach_thumb_failed. GIF images: Undefined variable written.

    1. Welcome to VaultWiki.org, home of the wiki add-on for vBulletin and XenForo!

      VaultWiki allows your existing forum users to collaborate on creating and managing a site's content pages. VaultWiki is a fully-featured and fully-supported wiki solution for vBulletin and XenForo.

      The VaultWiki Team encourages you to join our community of forum administrators and check out VaultWiki for yourself.

    Issue: JPG images: Error while resizing: vw_attach_thumb_failed. GIF images: Undefined variable written.

    • Issue Tools
      • View Changes
    1. issueid=5433 July 17, 2018 11:32 AM
      ACL ACL is offline
      Regular Member
      JPG images: Error while resizing: vw_attach_thumb_failed. GIF images: Undefined variable written.

      I am unable to upload *.jpg image files for some reason. When I try to upload a JPG image as a new wiki attachment, or as a new file for an existing attachment, the process fails with an error next to the 'clear' button:
      Code:
      Error while resizing: vw_attach_thumb_failed
      This issue does not affect *.gif or *.png images.

      ----

      When uploading a *.gif image, there is no loss of functionality, but an error is logged:
      ErrorException: Undefined variable: written - vault/core/model/image/metadata/xmp/vw.php:662

      This error is similar to issue #5302, except that it originates from a different vaultwiki source file. Stack trace:
      Code:
      #0 /path/to/public_html/vault/core/model/image/metadata/xmp/vw.php(662): XenForo_Application::handlePhpError(8, 'Undefined varia...', '/path/to/public...', 662, Array)
      #1 /path/to/public_html/vault/core/model/image/metadata/xmp/vw.php(618): vw_Image_MetaData_XMP_Model->build()
      #2 /path/to/public_html/vault/core/model/image/metadata/xmp/vw.php(583): vw_Image_MetaData_XMP_Model->construct()
      #3 /path/to/public_html/vault/core/model/image/vw.php(1246): vw_Image_MetaData_XMP_Model->update()
      #4 /path/to/public_html/vault/core/model/image/vw.php(1201): vw_Image_Instance_Model->assert_metadata(Object(vw_Image_Structure_GIF_Model), Object(vw_Image_Format_GIF_Model), true, 0)
      #5 /path/to/public_html/vault/core/model/image/vw.php(994): vw_Image_Instance_Model->assert_metadata_in_object(Object(vw_Image_Format_GIF_Model))
      #6 /path/to/public_html/vault/core/controller/dm/attach/thumb/vw.php(410): vw_Image_Instance_Model->resize(180, 115, 'gif')
      #7 /path/to/public_html/vault/core/controller/dm/attach/thumb/vw.php(130): vw_DM_Attach_Thumb_Controller->create_thumbnail('gif', Object(vw_Image_Format_GIF_Model), 180, 400)
      #8 /path/to/public_html/library/vw/XenForo/DataWriter.php(512): vw_DM_Attach_Thumb_Controller->pre_save(true)
      #9 /path/to/public_html/library/XenForo/DataWriter.php(1460): vw_XenForo_DataWriter->_preSave()
      #10 /path/to/public_html/library/vw/XenForo/DataWriter.php(192): XenForo_DataWriter->preSave()
      #11 /path/to/public_html/vault/core/controller/dm/xf.php(402): vw_XenForo_DataWriter->preSaveWithReturn()
      #12 /path/to/public_html/vault/core/controller/dm/attach/file/vw.php(1309): vw_DM_Controller_XF->pre_save()
      #13 /path/to/public_html/vault/core/controller/dm/attach/file/vw.php(524): vw_DM_Attach_File_Controller->create_thumbnails()
      #14 /path/to/public_html/library/vw/XenForo/DataWriter.php(505): vw_DM_Attach_File_Controller->post_save_each()
      #15 /path/to/public_html/library/XenForo/DataWriter.php(1423): vw_XenForo_DataWriter->_postSave()
      #16 /path/to/public_html/vault/core/controller/dm/xf.php(436): XenForo_DataWriter->save()
      #17 /path/to/public_html/vault/core/controller/ui/ajax/upload/vw.php(125): vw_DM_Controller_XF->save()
      #18 /path/to/public_html/library/vw/XenForo/ControllerPublic/Wiki/Ajax.php(50): vw_UI_AJAX_Upload_Controller->execute()
      #19 /path/to/public_html/library/XenForo/FrontController.php(369): vw_XenForo_ControllerPublic_Wiki_Ajax->actionIndex()
      #20 /path/to/public_html/library/XenForo/FrontController.php(152): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
      #21 /home/auschr1/public_html/index.php(13): XenForo_FrontController->run()
      #22 {main}
    Issue Details
    Issue Number 5433
    Issue Type Bug
    Project VaultWiki 4.x Series
    Category Attachments
    Status Fixed
    Priority 3 - Loss of Functionality
    Affected Version 4.0.23
    Fixed Version 4.0.23
    Milestone (none)
    Software DependencyAny
    License TypePaid
    Users able to reproduce bug 0
    Users unable to reproduce bug 0
    Attachments 0
    Assigned Users (none)
    Tags (none)




    1. July 17, 2018 4:08 PM
      pegasus pegasus is offline
      VaultWiki Team
      Processing that particular image failed for some reason, usually due to errors in the image file's metadata. VaultWiki will not accept damaged image files. Does the upload also fail on our demo? You can email the image to "support" for testing, so we can confirm whether there is a problem with the image or a bug.
      Reply Reply  
    2. July 18, 2018 6:35 AM
      ACL ACL is offline
      Regular Member
      I have downloaded an existing *.jpg image from the VW demo and tried uploading it to my site... unfortunately it failed with the same resize error message as above.

      The test image was sourced from https://www.vaultwiki.org/pages/Imag...eate-Group-jpg

      I tried uploading a 64x64 JPG picture created in Photoshop and it works OK (probably because it doesn't need resizing?). The same image resized to 200x200 JPG before saving from Photoshop fails with the resize error again.

      On VaultWiki.org vB demo, the 200x200 image uploads OK, no error. On the VaultWiki.org XF demo, the 200x200 image upload fails with the resize error. I'll send you my 200x200 test image.
      Reply Reply  
    3. July 18, 2018 1:06 PM
      pegasus pegasus is offline
      VaultWiki Team
      It seems like this is related to this PHP bug: https://bugs.php.net/bug.php?id=39593

      It occurs when a lower priority XMP-namespace field is moved from the JPG's extended XMP data to the 'standard' XMP data because there were no fields in the standard XMP-namespace.

      Our XenForo demo uses a later version of PHP than the vBulletin demo, so I think one of the more recent replies about changing the error message from a warning to an exception is in effect. This means that the underlying bug is probably occurring in vBulletin, but is not preventing the image output. In vBulletin, this is arguably a legal vulnerability, because according to some countries laws' the image must retain the original metadata values for certain fields if they exist on the image (the test image contains a field stating that the image was created in PhotoShop).

      In our case, we reference the same DOMNode in multiple arrays, which seems to be triggering the PHP bug. This can be worked around by placing clones of the same node into each array. In vault/core/model/image/metadata/xmp/jpg/vw.php, find:
      Code:
      $standard[] = $node['node'];
      					$avail -= $extendlen;
      Replace with:
      Code:
      $standard[] = $node['node']->cloneNode(true);
      					$avail -= $extendlen;
      The full fix will also fix a bug where XMP fields that were moved into the standard XMP block still appeared in the extended XMP block.
      Reply Reply  
    4. July 18, 2018 3:47 PM
      ACL ACL is offline
      Regular Member
      Thank you for the details and fix! I am now able to upload the 200x200 image successfully.

      I upgraded to PHP 7.1 a few weeks ago so what you've said does make sense. This version is said be the minimum recommended PHP release when XenForo 2.1 becomes available, so I've made the switch early
      Reply Reply  
    + Reply

    Assigned Users
    Loading Please Wait
    Tags
    Loading Please Wait
    • Contact Us
    • License Agreement
    • Privacy
    • Terms
    • Top
    All times are GMT -4. The time now is 7:16 AM.
    This site uses cookies to help personalize content, to tailor your experience, and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Learn more… Accept Remind me later
  • striker
    Powered by vBulletin® Version 4.2.5 Beta 2
    Copyright © 2025 vBulletin Solutions Inc. All rights reserved.
    Search Engine Optimisation provided by DragonByte SEO (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
    Copyright © 2008 - 2024 VaultWiki Team, Cracked Egg Studios, LLC.