Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Get rid of the PIL dependency

PIL was used to convert PNG into JPEG files to feed ffmpeg because older releases
of ffmpeg had issue with PNG.

It seems now OK to accept PNG too. Affected user can download a static linked
version of ffmpeg as a workaround.

Removing PIL is important because it prevented the port of infoqscraper to python 3.
  • Loading branch information...
commit 2eec10e1ed3a23ee9b81b85e6471c22a9748f565 1 parent 6767dde
@cykl authored
View
1  CHANGES.txt
@@ -8,6 +8,7 @@
* h264_overlay:
Display both the slides and the speake. Use x264, encoding is much
slower than h264 (~10x)
+ - Removed PIL dependency
0.0.8:
- Fix a regression introduced by 0.0.7, ffmpeg 0.8 does not support -n
View
3  README.md
@@ -12,7 +12,7 @@ the presenter but you don't get the slide.
* download the resources (video, audio track, slides)
* build a movie including the slides and the audio track from the resources
-Only Python 2.6 or later is currently supported since PIL is not yet available for Python 3.
+Only Python 2.6 or later is currently supported.
# Install
@@ -108,7 +108,6 @@ Use `infoqscraper presentation download -h` to learn more.
The following python packages are required:
1. BeautifulSoup4
-3. PIL
For normal users, they are automatically installed by `pip`. However, if you plan to hack `infoqscraper` you will
most likely install them using the `requirements.txt` file:
View
2  infoqscraper/presentation.py
@@ -407,7 +407,7 @@ def _convert_slides(self, slides):
def convert(slide):
if slide.endswith("swf"):
- return swf_render.to_jpeg(slide)
+ return swf_render.to_png(slide)
elif slide.endswith("jpg"):
return slide
else:
View
6 infoqscraper/test/test_utils.py
@@ -67,9 +67,3 @@ def test_swf(self):
converter.to_png(swf_path, png_path)
stat_info = os.stat(png_path)
self.assertGreater(stat_info.st_size, 1000)
-
- # SWF -> JPEG
- jpg_path = swf_path.replace('.swf', '.jpg')
- converter.to_jpeg(swf_path, jpg_path)
- stat_info = os.stat(jpg_path)
- self.assertGreater(stat_info.st_size, 1000)
View
19 infoqscraper/utils.py
@@ -21,13 +21,9 @@
# 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.
-import os
import subprocess
import sys
-import Image
-import subprocess
-import tempfile
if sys.hexversion >= 0x02070000:
check_output = subprocess.check_output
@@ -91,18 +87,3 @@ def to_png(self, swf_path, png_path=None):
return png_path
- def to_jpeg(self, swf_path, jpg_path=None):
- """ Convert a slide into a PNG image.
-
- OSError is raised if swfrender is not available.
- An exception is raised if image cannot be created.
- """
- if not jpg_path:
- jpg_path = swf_path.replace(".swf", ".jpg")
-
- png_path = tempfile.mktemp(suffix=".png")
- self.to_png(swf_path, png_path)
- Image.open(png_path).convert('RGB').save(jpg_path, 'jpeg')
- os.remove(png_path)
- return jpg_path
-
View
1  requirements.txt
@@ -1,4 +1,3 @@
BeautifulSoup4
-PIL
unittest2
View
1  setup.py
@@ -29,7 +29,6 @@
install_requires=[
"BeautifulSoup4",
"html5lib",
- "PIL",
]
if sys.version_info < (2, 7):
install_requires += ['argparse']
Please sign in to comment.
Something went wrong with that request. Please try again.