Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

assets.php 7.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226
  1. <?php
  2. return [
  3. 'image_manipulation' => [
  4. /*
  5. |--------------------------------------------------------------------------
  6. | Route Prefix
  7. |--------------------------------------------------------------------------
  8. |
  9. | The route prefix for serving HTTP based manipulated images through Glide.
  10. | If using the cached option, this should be the URL of the cached path.
  11. |
  12. */
  13. 'route' => 'img',
  14. /*
  15. |--------------------------------------------------------------------------
  16. | Require Glide security token
  17. |--------------------------------------------------------------------------
  18. |
  19. | With this option enabled, you are protecting your website from mass image
  20. | resize attacks. You will need to generate tokens using the Glide tag
  21. | but may want to disable this while in development to tinker.
  22. |
  23. */
  24. 'secure' => true,
  25. /*
  26. |--------------------------------------------------------------------------
  27. | Image Manipulation Driver
  28. |--------------------------------------------------------------------------
  29. |
  30. | The driver that will be used under the hood for image manipulation.
  31. | Supported: "gd" or "imagick" (if installed on your server)
  32. |
  33. */
  34. 'driver' => 'gd',
  35. /*
  36. |--------------------------------------------------------------------------
  37. | Additional Image Extensions
  38. |--------------------------------------------------------------------------
  39. |
  40. | Define any additional image file extensions you would like Statamic to
  41. | process. You should ensure that both your server and the selected
  42. | image manipulation driver properly supports these extensions.
  43. |
  44. */
  45. 'additional_extensions' => [
  46. // 'heic',
  47. ],
  48. /*
  49. |--------------------------------------------------------------------------
  50. | Save Cached Images
  51. |--------------------------------------------------------------------------
  52. |
  53. | Enabling this will make Glide save publicly accessible images. It will
  54. | increase performance at the cost of the dynamic nature of HTTP based
  55. | image manipulation. You will need to invalidate images manually.
  56. |
  57. */
  58. 'cache' => false,
  59. 'cache_path' => public_path('img'),
  60. /*
  61. |--------------------------------------------------------------------------
  62. | Image Manipulation Defaults
  63. |--------------------------------------------------------------------------
  64. |
  65. | You may define global defaults for all manipulation parameters, such as
  66. | quality, format, and sharpness. These can and will be be overwritten
  67. | on the tag parameter level as well as the preset level.
  68. |
  69. */
  70. 'defaults' => [
  71. // 'quality' => 50,
  72. ],
  73. /*
  74. |--------------------------------------------------------------------------
  75. | Image Manipulation Presets
  76. |--------------------------------------------------------------------------
  77. |
  78. | Rather than specifying your manipulation params in your templates with
  79. | the glide tag, you may define them here and reference their handles.
  80. | They may also be automatically generated when you upload assets.
  81. | Containers can be configured to warm these caches on upload.
  82. |
  83. */
  84. 'presets' => [
  85. // 'small' => ['w' => 200, 'h' => 200, 'q' => 75, 'fit' => 'crop'],
  86. ],
  87. /*
  88. |--------------------------------------------------------------------------
  89. | Generate Image Manipulation Presets on Upload
  90. |--------------------------------------------------------------------------
  91. |
  92. | By default, presets will be automatically generated on upload, ensuring
  93. | the cached images are available when they are first used. You may opt
  94. | out of this behavior here and have the presets generated on demand.
  95. |
  96. */
  97. 'generate_presets_on_upload' => true,
  98. ],
  99. /*
  100. |--------------------------------------------------------------------------
  101. | Auto-Crop Assets
  102. |--------------------------------------------------------------------------
  103. |
  104. | Enabling this will make Glide automatically crop assets at their focal
  105. | point (which is the center if no focal point is defined). Otherwise,
  106. | you will need to manually add any crop related parameters.
  107. |
  108. */
  109. 'auto_crop' => true,
  110. /*
  111. |--------------------------------------------------------------------------
  112. | Control Panel Thumbnail Restrictions
  113. |--------------------------------------------------------------------------
  114. |
  115. | Thumbnails will not be generated for any assets any larger (in either
  116. | axis) than the values listed below. This helps prevent memory usage
  117. | issues out of the box. You may increase or decrease as necessary.
  118. |
  119. */
  120. 'thumbnails' => [
  121. 'max_width' => 10000,
  122. 'max_height' => 10000,
  123. ],
  124. /*
  125. |--------------------------------------------------------------------------
  126. | File Previews with Google Docs
  127. |--------------------------------------------------------------------------
  128. |
  129. | Filetypes that cannot be rendered with HTML5 can opt into the Google Docs
  130. | Viewer. Google will get temporary access to these files so keep that in
  131. | mind for any privacy implications: https://policies.google.com/privacy
  132. |
  133. */
  134. 'google_docs_viewer' => false,
  135. /*
  136. |--------------------------------------------------------------------------
  137. | Cache Metadata
  138. |--------------------------------------------------------------------------
  139. |
  140. | Asset metadata (filesize, dimensions, custom data, etc) will get cached
  141. | to optimize performance, so that it will not need to be constantly
  142. | re-evaluated from disk. You may disable this option if you are
  143. | planning to continually modify the same asset repeatedly.
  144. |
  145. */
  146. 'cache_meta' => true,
  147. /*
  148. |--------------------------------------------------------------------------
  149. | Focal Point Editor
  150. |--------------------------------------------------------------------------
  151. |
  152. | When editing images in the Control Panel, there is an option to choose
  153. | a focal point. When working with third-party image providers such as
  154. | Cloudinary it can be useful to disable Statamic's built-in editor.
  155. |
  156. */
  157. 'focal_point_editor' => true,
  158. /*
  159. |--------------------------------------------------------------------------
  160. | Enforce Lowercase Filenames
  161. |--------------------------------------------------------------------------
  162. |
  163. | Control whether asset filenames will be converted to lowercase when
  164. | uploading and renaming. This can help you avoid file conflicts
  165. | when working in case-insensitive filesystem environments.
  166. |
  167. */
  168. 'lowercase' => true,
  169. /*
  170. |--------------------------------------------------------------------------
  171. | Additional Uploadable Extensions
  172. |--------------------------------------------------------------------------
  173. |
  174. | Statamic will only allow uploads of certain approved file extensions.
  175. | If you need to allow more file extensions, you may add them here.
  176. |
  177. */
  178. 'additional_uploadable_extensions' => [],
  179. /*
  180. |--------------------------------------------------------------------------
  181. | SVG Sanitization
  182. |--------------------------------------------------------------------------
  183. |
  184. | Statamic will automatically sanitize SVG files when uploaded to avoid
  185. | potential security issues. However, if you have a valid reason for
  186. | disabling this, and you trust your users, you may do so here.
  187. |
  188. */
  189. 'svg_sanitization_on_upload' => true,
  190. ];