Advertisement:

Author Topic: SVG As Image Attachment Support  (Read 1515 times)

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,815
  • Mod King
    • XPtsp.com Community
SVG As Image Attachment Support
« on: March 01, 2016, 06:41:40 PM »
Link to Mod


SVG AS IMAGE ATTACHMENT SUPPORT v1.4
By Dougiefresh -> Link to Mod


Introduction
This mod allows the forum to properly process a SVG file so that it is displayed as an image beneath the post, complete with original image dimensions and size, instead showing of a download-only link for the SVG file.  It will also attempt to convert the SVG image to either a PNG image, provided that the PNG function and the ImageMagic extensions are installed.  If the PNG functions aren't available, then it will convert it to a JPEG image.

Upon install, this mod attempts to change any existing SVG file attachments so that they can be viewed.

Upon uninstall, this mod removes the image dimensions from SVG images in order to prevent SVG thumbnails from being shown at full size.

Admin Settings
There are two new buttons under Admin -> Forum -> Attachments and Avatars -> File Maintenance, at the bottom of the page under SVG Attachments.

The 1st button will populate existing SVG files that don't have image dimensions and mime-type data in the attachments table, while the 2nd button removes the image dimensions from the attachments table.

Compatibility Notes
This mod was tested on SMF 2.0.11 and SMF 2.1 Beta 3, but should work on SMF 2.0 and up.  SMF 2.1 Beta 2 and SMF 1.x will not be supported.

PM Attachments should be installed prior to this mod being installed if you want SVG attachments in Personal Messages to show up properly.

Changelog
The changelog can be viewed at XPtsp.com.

License
Copyright (c) 2016 - 2018, Douglas Orend
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,815
  • Mod King
    • XPtsp.com Community
Re: SVG As Image Attachment Support
« Reply #1 on: December 11, 2016, 10:52:41 AM »
Uploaded v1.1 - December 11th, 2016
o Changed mod uninstall code to look for mime type instead of file extensions.
o Added SMF 2.1 support to the mod.  No changes for SMF 2.0.x-branch.

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,815
  • Mod King
    • XPtsp.com Community
Re: SVG As Image Attachment Support
« Reply #2 on: July 08, 2017, 10:14:01 AM »
Uploaded v1.2 - July 8th, 2017
o Added support for SMF 2.1 Beta 3.
o Removed support for SMF 2.1 Beta 2.

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,815
  • Mod King
    • XPtsp.com Community
Re: SVG As Image Attachment Support
« Reply #3 on: November 08, 2018, 09:31:13 PM »
Uploaded v1.3 - November 8th, 2018
o No functionality change.
o Updated documentation to point to new website.

Offline Rock Lee

  • Native Language Support Specialist
  • SMF Hero
  • *
  • Posts: 1,995
  • Gender: Male
  • I also speak english :D
    • BomberCode.Oficial on Facebook
    • RockLee-BC on GitHub
    • @Bomber_Code on Twitter
    • Bomber Code ~ La nueva era del conocimiento
Re: SVG As Image Attachment Support
« Reply #4 on: November 09, 2018, 12:51:30 PM »
I thought I translated it ... layers was dejavu ::) I leave the translation!


Regards!
¡Regresando como cual Fenix! ~ Bomber Code © 2018
Ayudas - Aportes - Tutoriales - Y mucho mas!!!


Ayudame via PayPal

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,815
  • Mod King
    • XPtsp.com Community
Re: SVG As Image Attachment Support
« Reply #5 on: November 09, 2018, 07:31:07 PM »
Uploaded v1.4 - November 9th, 2018
o Added Spanish Latin translation, courtsey of Rock Lee!



@Rock Lee:  Thank you for the translation!  It's been included in this version!