Posts

Ktools PhotoStore batch image regenerate

Ktools PhotoStoreThe Ktools PhotoStore software (www.ktools.net) automatically generates thumbnails, sample and large images with watermarks of the images in the database. If you change the settings regarding the image sizes only newly added images will get the new sizes.

The following simple script regenerates / resizes the thumbnails, sample and large images from the original images. It runs in batch mode, i.e it will work on every image you have in your stock_photos folder. It will overwrite your current i_, s_ and m_-versions of your images without warning. The sizes is set in the script (it does not read the current settings in the manager).

#!/bin/sh
# ps_regenerate.sh for Ktools Photo Store - http://www.ktools.net
# Copyright 2010-12-27 HelTech Communication, Stefan Helander
# http://www.heltech.se
#
# This script may be downloaded from https://nerdia.net and used for free. It is not
# allowed to redistribute this script without written permission.
#
# Requires GraphicsMagick - gm
#
# Regenerates thumbnail, sample and large images for Ktools Photo Store.
# Copy this file to photostoreroot/stock_photos and execute it
# in that folder. If necessary adjust the sizes below.
# !!! WARNING !!! This script overwrites current m_, s_ and i_versons
# of your current images without question.
#
I_SIZE=”150″
S_SIZE=”500″
M_SIZE=”1200″
COMMAND=”gm convert”
FILES=`ls *.jpg | grep -v “^m_” | grep -v “^s_” | grep -v “^i_”`
for FILE in $FILES
do

# Make i_ image
$COMMAND -size $I_SIZE "$FILE" -resize $I_SIZE "i_$FILE"
# Make s_ image
$COMMAND -size $S_SIZE "$FILE" -resize $S_SIZE "s_$FILE"
# Make m_ image
$COMMAND -size $M_SIZE "$FILE" -resize $M_SIZE "m_$FILE"

done

WordPress insert image/video/music problem caused by plugin

When writing a post in WordPress, and you press Upload/Insert buttons to insert images, video, music or other media you can run into a problem where a popup displaying “Are you sure you want to do this?” is showing instead of the normal insert screen. The problem is described here. As mentioned in the posts, it is caused by some plugin. This can be hard to guess as the plugin in question might have nothing to do with writing and posting articles.

I ran into this problem using the latest WordPress 3.0.1. The plugin that was causing trouble for me was WP-ContactForm. By disabling it, it was possible to insert images in the posts again.

If you experience this problem, try disabling all plugins. If inserting images now works, try enabling the plugins one by one to figure out which one is causing the trouble.