Skip to content
This repository has been archived by the owner on Nov 23, 2018. It is now read-only.

Adding format=mp4 parameter to convert gif files into mp4 (reduces file size) #30

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

xiam
Copy link
Contributor

@xiam xiam commented Dec 16, 2015

No description provided.

ADD http://sourceforge.net/projects/libjpeg-turbo/files/1.4.2/libjpeg-turbo-official_1.4.2_amd64.deb/download /tmp/libjpeg-turbo-official_1.4.2_amd64.deb
RUN cd /tmp && dpkg -i /tmp/libjpeg-turbo-official_1.4.2_amd64.deb && \
echo /opt/libjpeg-turbo/lib64 > /etc/ld.so.conf.d/libjpeg-turbo.conf && ldconfig
RUN wget -q https://sourceforge.net/projects/libjpeg-turbo/files/1.4.2/libjpeg-turbo-official_1.4.2_amd64.deb/download -O /tmp/libjpeg-turbo-official_1.4.2_amd64.deb && \
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ADD command was downloading the sources each time docker build was called. This RUN operation does the same and it's cached by its docker layer, no need to download it each time.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very interesting catch!

@@ -345,6 +368,17 @@ func (i *Image) sizeFrames(sz *imgry.Sizing) error {
}

func (i *Image) WriteToFile(fn string) error {
if i.convertFormat != i.format {
if i.convertFormat == "mp4" {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an special case, we may be able to support different destination files, but for now we only expect mp4. This is only for writing the file to disk.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants