<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://wiki.eprints.org/w/index.php?action=history&amp;feed=atom&amp;title=Media_info.pl</id>
	<title>Media info.pl - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.eprints.org/w/index.php?action=history&amp;feed=atom&amp;title=Media_info.pl"/>
	<link rel="alternate" type="text/html" href="https://wiki.eprints.org/w/index.php?title=Media_info.pl&amp;action=history"/>
	<updated>2026-04-23T08:55:44Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.31.8</generator>
	<entry>
		<id>https://wiki.eprints.org/w/index.php?title=Media_info.pl&amp;diff=14528&amp;oldid=prev</id>
		<title>Drn@ecs.soton.ac.uk at 10:28, 7 February 2022</title>
		<link rel="alternate" type="text/html" href="https://wiki.eprints.org/w/index.php?title=Media_info.pl&amp;diff=14528&amp;oldid=prev"/>
		<updated>2022-02-07T10:28:56Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en-GB&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 10:28, 7 February 2022&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l4&quot; &gt;Line 4:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 4:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;'''media_info.pl''' contains triggers and functions for automatically setting media information of uploaded files.&amp;#160; First it has the function &amp;lt;code&amp;gt;$c-&amp;gt;{guess_doc_type}&amp;lt;/code&amp;gt; which attempts to guess the document type.&amp;#160; Initially from some hard-coded tests for common file extensions for documents of types: ''text'', ''slideshow'', ''archive'' or ''spreadsheet''.&amp;#160; Then it will use &amp;lt;code&amp;gt;$c-&amp;gt;{mimemap}&amp;lt;/code&amp;gt; generated by [[mime_types.pl]].&amp;#160; If it finds nothing it will return document type ''other''.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;'''media_info.pl''' contains triggers and functions for automatically setting media information of uploaded files.&amp;#160; First it has the function &amp;lt;code&amp;gt;$c-&amp;gt;{guess_doc_type}&amp;lt;/code&amp;gt; which attempts to guess the document type.&amp;#160; Initially from some hard-coded tests for common file extensions for documents of types: ''text'', ''slideshow'', ''archive'' or ''spreadsheet''.&amp;#160; Then it will use &amp;lt;code&amp;gt;$c-&amp;gt;{mimemap}&amp;lt;/code&amp;gt; generated by [[mime_types.pl]].&amp;#160; If it finds nothing it will return document type ''other''.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This file also contains four trigger functions:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This file also contains four &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;code&amp;gt;EP_TRIGGER_MEDIA_INFO&amp;lt;/code&amp;gt; &lt;/ins&gt;trigger functions:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Tests that the uploaded file is of a recognizable MIME type and sets the document object's ''mime_type'' field.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Tests that the uploaded file is of a recognizable MIME type and sets the document object's ''mime_type'' field.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# If an audio/video file use FFMPEG to extract information to set the document object's ''media_duration'', ''media_width'', ''media_height'', ''media_video_codec''/''media_audio_codec'', and ''media_aspect_ratio''.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# If an audio/video file use FFMPEG to extract information to set the document object's ''media_duration'', ''media_width'', ''media_height'', ''media_video_codec''/''media_audio_codec'', and ''media_aspect_ratio''.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Uses the &amp;lt;code&amp;gt;$c-&amp;gt;{mimemap}&amp;lt;/code&amp;gt; to set the document object's ''mime_type'' field if not already set.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Uses the &amp;lt;code&amp;gt;$c-&amp;gt;{mimemap}&amp;lt;/code&amp;gt; to set the document object's ''mime_type'' field if not already set.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Uses the &amp;lt;code&amp;gt;$c-&amp;gt;{guess_doc_type}&amp;lt;/code&amp;gt; function to&amp;#160; set the document object's ''mime_type'' field, if not already set.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Uses the &amp;lt;code&amp;gt;$c-&amp;gt;{guess_doc_type}&amp;lt;/code&amp;gt; function to&amp;#160; set the document object's ''mime_type'' field, if not already set.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Drn@ecs.soton.ac.uk</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.eprints.org/w/index.php?title=Media_info.pl&amp;diff=14524&amp;oldid=prev</id>
		<title>Drn@ecs.soton.ac.uk: Added config file page.</title>
		<link rel="alternate" type="text/html" href="https://wiki.eprints.org/w/index.php?title=Media_info.pl&amp;diff=14524&amp;oldid=prev"/>
		<updated>2022-02-07T10:19:22Z</updated>

		<summary type="html">&lt;p&gt;Added config file page.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{dirs}}&lt;br /&gt;
{{cfgd}}&lt;br /&gt;
&lt;br /&gt;
'''media_info.pl''' contains triggers and functions for automatically setting media information of uploaded files.  First it has the function &amp;lt;code&amp;gt;$c-&amp;gt;{guess_doc_type}&amp;lt;/code&amp;gt; which attempts to guess the document type.  Initially from some hard-coded tests for common file extensions for documents of types: ''text'', ''slideshow'', ''archive'' or ''spreadsheet''.  Then it will use &amp;lt;code&amp;gt;$c-&amp;gt;{mimemap}&amp;lt;/code&amp;gt; generated by [[mime_types.pl]].  If it finds nothing it will return document type ''other''.&lt;br /&gt;
&lt;br /&gt;
This file also contains four trigger functions:&lt;br /&gt;
# Tests that the uploaded file is of a recognizable MIME type and sets the document object's ''mime_type'' field.&lt;br /&gt;
# If an audio/video file use FFMPEG to extract information to set the document object's ''media_duration'', ''media_width'', ''media_height'', ''media_video_codec''/''media_audio_codec'', and ''media_aspect_ratio''.&lt;br /&gt;
# Uses the &amp;lt;code&amp;gt;$c-&amp;gt;{mimemap}&amp;lt;/code&amp;gt; to set the document object's ''mime_type'' field if not already set.&lt;br /&gt;
# Uses the &amp;lt;code&amp;gt;$c-&amp;gt;{guess_doc_type}&amp;lt;/code&amp;gt; function to  set the document object's ''mime_type'' field, if not already set.&lt;/div&gt;</summary>
		<author><name>Drn@ecs.soton.ac.uk</name></author>
		
	</entry>
</feed>