Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
S sgt-sterling-filemanager
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 4
    • Issues 4
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • SGT - Public
  • sgt-sterling-filemanager
  • Issues
  • #5

Closed
Open
Created Feb 23, 2017 by Administrator@rootOwner

Add support for non-jpeg thumbnail rendering

Created originally on Bitbucket by lambjs (Josh Lamb)

Currently thumbnail rendering is only supported for JPEG files. We'd like to add support for a number of other formats including:

PNG, BMP, GIF, TIF

$thumb_fullpath is set with the same extension as the actual file - this is done so that the real URL ie. image.png can be served when user requests image.png?thumb. This behavior should be preserved, so the final creation of the thumb must be done in the proper extension format ie. line 2397 imagejpeg cannot be used to create jpeg thumbs for every file; PNG's must have PNG thumbs.

The IF statement between lines 2391 - 2404 handles the creation of these thumbs.

  1. The following two functions need to be replaced by generic functions:

imagejpeg -> image_output($resource, $target_path, $quality) imagecreatefromjpeg -> image_create_from_path($source_path)

  1. In both image_output and image_create_from_path, detect the type of image processing function that needs to be used based on the source or target path's extension. ie. if the path ends in .jpg, use imagejpeg within image_output(). Throw an exception if the resulting image resource is false or if support for this type of image is not implemented currently.

  2. You'll need to catch the exception and react appropriately wherever image_output or image_create_from_path is called.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking