I put a lot of images JPG and PNG in a folder. That folder was using the thumbnails view but only PNG images are showed in the thumbnails. I was using Plone 4.1 using a very simple buildout:
[buildout]
extends =
http://dist.plone.org:5021/release/4.1/versions.cfg
parts = instance
[instance]
recipe = plone.recipe.zope2instance
user = user:pass
eggs =
Plone
Then I tried to rotate a JPG image and I got the next error:
Traceback (innermost last):
Module ZPublisher.Publish, line 126, in publish
Module ZPublisher.mapply, line 77, in mapply
Module ZPublisher.Publish, line 46, in call_object
Module Products.ATContentTypes.lib.imagetransform, line 205, in transformImage
Module PIL.Image, line 1676, in transpose
Module PIL.ImageFile, line 189, in load
Module PIL.Image, line 385, in _getdecoder
IOError: decoder jpeg not available
So I tried installing libjpeg8 and libjpeg8-dev (with apt-get because I'm working with debian 6). Also I changed the buildout adding the appropiate line for the Pillow egg:
[buildout]
extends =
http://dist.plone.org:5021/release/4.1/versions.cfg
parts = instance
[instance]
recipe = plone.recipe.zope2instance
user = user:pass
eggs =
Plone
Pillow
And now the JPEG thumbnails are displayed.
Thanks for your help. I got a bit confused with buildout at beginning.
Which operating system are you using? Did you compile PIL with JPEG support? You are mostly missing something around those lines, so grab your buildout.cfg and add something like this:
...
[instance]
...
eggs =
PILwoTk
...
Try running the buildout again in another folder (so that is completely fresh) and try to see what you get when it compiles PILwoTk, to JPEG support to work you should see something like this:
# Now you'll see
# --------------------------------------------------------------------
# *** TKINTER support not available
# --- JPEG support ok
# --- ZLIB (PNG/ZIP) support ok
# --- FREETYPE2 support ok
# -------------------
If JPEG support ok is not what you get, you are most likely (definitely) missing jpeg development headers.
Images in Plone are resized during upload. Your formerly uploaded images are not resized or rotated or whatever because the library wasn't there. Now you have a working PIL/Pillow. Re-upload the image and it will work. But you can all images manually in the ZMI. Visit portal_atct and choose the tab 'Image scales'. Then recreate. All images are recalculated. That can last long time depending on the amount of images.
Related
I am trying to build a website using blogdown, and the Hugo theme Sam.
This theme has SASS files that get converted into a minified css file.
When I change something in the SASS file, like for example the background color, it is not taken into account when using serve_site.
Is there a way to make this work using blogdown?
A way to reproduce the issue is:
Create an empty directory called for ex. test_sam, and set it as a working directory
then do:
library(blogdown)
new_site(theme = "victoriadrake/hugo-theme-sam")
Try to change something in test_sam/themes/hugo-theme-sam/assets/sass/style.sass, for example:
change
html
background-color: $dark-grey
to
html
background-color: $white
This doesn't produce any change.
Color variables (such as $white) are defined in test_sam/themes/hugo-theme-sam/assets/sass/_vars.sass
The odd thing is that if I change it to an undefined variable name like $yellow, I get the following error message:
Building sites … ERROR 2019/12/27 20:44:39 Transformation failed: SCSS
processing failed: file "stdin", line 11, col 23: Undefined variable:
"$yellow". Total in 197 ms Error: Error building site: logged 1
error(s)
which shows that blogdown does access the sass files to build the site.
I have very little knowledge about website building nor css, so maybe there is something quite obvious that I'm not getting.
Thanks for your help!
Although late to answer, I solved this issue with the same theme by setting the "blogdown.generator.server" option to TRUE.
options("blogdown.generator.server" = TRUE)
blogdown::serve_site()
Update: This actually seems to be a common issue with the Sam theme specifically. The theme uses some tools not included with Hugo, and you have to download them separately. It's addressed in the README.
Open Terminal and run:
npm install -g postcss-cli
npm install -g autoprefixer
After that, blogdown::serve_site() worked normally for me. It also fixed some plot rendering issues I was having.
I simply want to open an AVI file with AviSynth and feed it into VirtualDub. However, when I open my .avs script (consisting of just one AviSource() call), I get the following error:
Avisynth open failure:
AVISource: Couldn't locate a decompressor for fourcc dvds
(H:\Videos\QTGMC\test.avs, line 1)
The required dvsd codec seems to be installed, according to software called GSpot (which identifies a video file's required codec's). Does anyone know why I can't open this file and how to fix it?
In case anyone has the same issue in the future, I solved it by installing Cedocida codec: http://www.cithraidt.de/cedocida/index.html#download.
Using DirectShowSource() instead of AviSource() also works.
You can use FmpegSource2() - it does not use codecs from the system like AVISource() or DirectShowSource() and recognizes a lot of modern format with frame accuracy.
Basically, it supports all the formats FFMPEG does.
I am trying to write a Jekyll converter for R Markdown files. I created RMarkdownConverter.rb and placed it in my _plugins directory. I have verified that other plugins are working but this one is not. I also don't see any error messages, including the ones I put in myself. It seems this is not being used. However, Jekyll is generating an HTML file for my .Rmd file but simply processes the R chuck as code chuck. Any help or thoughts would be greatly appreciated.
RMarkdownConverter.rb file:
module Jekyll
class RMarkdownConverter < Converter
safe true
priority :low
def setup
STDERR.puts "Setting up R Markdown..."
return if #setup
require 'rinruby'
#setup = true
rescue
STDERR.puts 'do `gem install rinruby`'
raise FatalException.new("Missing dependency: rinruby")
end
def matches(ext)
ext =~ /Rmd/i
end
def output_ext(ext)
'.html'
end
def convert(content)
setup
STDERR.puts "Using R Markdown..."
R.eval "require(knitr)"
R.eval "render_markdown(strict=TRUE)"
R.assign "content", content
STDERR.puts content
R.eval "out <- knit(text=content)"
R.eval "print(out)"
end
end
end
The contents of my first R Markdown post:
---
layout: post
title: Using (R) Markdown, Jekyll, and Github for Blogging
published: true
tags: R R-Bloggers Jekyll github
type: post
status: publish
---
First, we need to install [RinRuby](https://sites.google.com/a/ddahl.org/rinruby-users/) to call R from Ruby. In the terminal, execute:
gem install rinruby
First R chuck:
```{r}
2 + 2
```
Try replacing the last few lines with the following
R.assign "content", content
R.eval "knitr::render_markdown(strict = TRUE)"
R.pull "(knitr::knit2html(text = content, fragment.only = TRUE))"
I think you need R.pull to copy the contents of R output to Ruby. Moreover, I would recommend directly converting from Rmd to html. I have used this strategy successfully in working with Ruhoh which is another ruby based blogging platform.
UPDATE. It is very odd but using the extension rmd seems to conflict with md. I changed it randomly to ram and jekyll seems to pick it up correctly. I am not sure why.
I'm confused by how the directory structure works. For example, mine is like:
--compass
--css
--images
--frontSprite
Images
-sass
--_base.scss
--advertiser.scss
config.rb
When I try to import my images I am using:
#import "frontSprite/*.png";
in my _base.scss, but this generates me an error which I feel is related to not finding the directory correctly. Any suggestions?
Well, the correct directory structure depends on what you've set in your config.rb.
Should look like that:
images_dir = "images"
http_images_path = "/this/path/is/rendered/in/the/css/file"
images_dir tells compass where the images lie (relative to the config.rb) and the http_images_path defines what is actually rendered in the CSS-output.
Try the command compass sprite "images/frontSprite/*.png" (this will generate the sprite css-output) from within your compass directory to debug the path.
Sidenote: When you work with .pngs you should consider installing oily png, this will remarkable speed up the sprite generation process. It's extremely simple just use gem install oily_png and Compass will automatically detect that it is installed.
If you are using Symfony & assetic
Go to config.yml & add this in parameters :
assetic.filter.compass.images_dir: %kernel.root_dir%/../src/App/PlayerBundle/Resources/public/assets/img/
I had this problem with compass in windows and solved it by editing this file:
C:\Ruby193\lib\ruby\gems\1.9.1\gems\compass-0.12.2\lib\compass\sprite_importer.rb
Change line 19:
- Dir.glob(File.join(path, "**", glob))
+ Sass::Util.glob(File.join(path, "**", glob))
And line 78:
- files = Dir[File.join(folder, uri)].sort
+ files = Sass::Util.glob(File.join(folder, uri)).sort
Save and it works!
Source:
https://github.com/chriseppstein/compass/commit/58babac01b56eddf63bac737f7f781d98f00f6b9
It's an old patch, so I wonder why it isn't in latest version of compass?
While I used to compile a single source file with Cmd+K in prior versions of Xcode, how does one do the same in Xcode 4? (Note that this is different than preprocessing or showing the disassembly of the file.) If compiling from a command line is proposed then it must be such that the project's settings, include paths, preprocessor definitions, etc., are all included.
An example use case is where I make a header file change but only want to test the change's effect with respect to a single source file, not all of the files that depend upon that header.
The command has been moved to the Perform Action submenu. Look under
Product > Perform Action > Compile filename.cpp
To assign Cmd+K to it, go to
File > Preferences > Key Bindings > Product Menu group
and you'll find Compile File where you can assign a key. Cmd+K is assigned to Clear Console now by default, so be sure to remove that binding to avoid conflicts.
One way that I have found to do this is to using the following menu commands:
Product -> Generate Output -> Generate Preprocessed File
Product -> Generate Output -> Generate Assembly File
This may not be exactly what you want, but it will compile the single file.
When you build a project, xcode runs compilation command. You can check the log, search for your file and copy paste that command on Terminal. It'll compile only the file for which you copy/pasted on the terminal.
If your file is C (or C++) file, then simply open your terminal, go to the folder in which the file resides and type
gcc -o outputFile inputFile.c
I am not familar with Objective-c that much, but GCC might work since it's only a superset of C, just like C++.
Hope that was helpful :)
The keyboard shortcut Cmd+K on Xcode 3 and before has been remapped to Cmd+B on Xcode 4
Along the same lines, Cmd+Return was remapped to Cmd+R (in case you ever used that)
The common requirement for single file compilation is checking it for syntax errors. (atleast for me). Since xcode4 highlights syntax errors as you type. It seems apple removed that feature.