does wordpress image cropping rely on some php library? - php

quick question:
i'm developing a wordpress theme for a client and have a heavy use of the_post_thumbnail function.
now, on my local dev site (running under MAMP) everything works like a charm and all the images get hard cropped to the correct size.
on the live dev site the cropping is completly ignored by wordpress. the output of the image is
.../wp-content/uploads/2010/06/07.jpg
but it should be
...wp-content/uploads/2010/06/07-160x230.jpg
after i changed my settings on the live/local dev site i used the ajax-thumbnail-rebuild plugin to rebuild all the images.. it just wont work on the live site.
now i read somewhere that the wordpress hard crop function relies on some php library calld php_hd2. can anyone confirm this?
//UPDATE
Thanks to Fredleys link it seems to be the GD library i meant. Which is installed on my server. sadly in the comments on the link people still have the problem despite GD being installed (which i can confirm for my server tomorrow).
But there is one interesting comment in there on the end of fredleys link:
wp_get_attachment_metadata() returns a hash without 'sizes' key. And that hash is returned by a call to apply_filters()
which sounds like my problem. i have all options in the backend available, nothing greyed out, and the images are available on the server.. they just won't get called on the frontend.
// UPDATE 2 & SOLVED
Ok. Found the Problem. The Server is running on Debian which has the gd_lib installed - BUT not the bundled Version. So there are things missing in this package. If you need to install the right version of gd_lib on Debian you'll find a nice solution here.

I think you mean gd2 and yes, you need to have it installed.

Related

Brackets live preview with php file

I discovered the editor "brackets" yesterday and tried to get it working. Now I have some trouble with the live preview, which does not seem to cooperate with php files.
I opened my folder, selected the index.php and when I clicked on live preview it requested for a base url (I am running brackets version 1.7 on windows 8.1 if this is of any relevance). I have also read some instructions about this problem here, but it all leads to the consequence that it isn't possible to actually use live preview but only local servers with php files. Does anyone perhaps have a solution for this?
Most of the instructions I read are already a little bit old so perhaps it is somehow possible now (preferably without needing a local server). I have heard so many positive things about the editor, I am actually really eager to use it.
Going with a local solution for now

Kint and Codeigniter MAMP vs LAMP

I'm currently developing a site on my mac using MAMP. I recently included the kint library and everything seems to be working fine.
The other day I copied the files over to my linux machine and the site is working fine, however, I get the message Unable to load the requested class: kint whenever I get to a page where kint has been loaded - this does not happen with on my mac and I haven't changed any other files.
So far I've tried loading'Kint/kint' (as one thred suggested) and I've also tried autoloading the file, but neither work, meanwhile everything is still fine on my mac???
If anyone could shed some light on this, thank you!
Thank you to #IsuthanBala.
The answer was to use the format 'Directory/Class' but making sure that the capitalisation was accurate as well (something I had not initially checked).
e.g.
$this->load->library('Kint/kint');

TimThumb not able to load images on Rackspace

So, we are using Linux, Apache, PHP 5.4.
I'm using Wordpress 3.5, which is where our problems started. I'm also using a theme from ThemeFuse.
I had to revert back to a really old version of TimThumb because the latest version doesnt seem to pleased with the PHP 5.4 or Wordpress 3.5.
Does anyone have any suggestion for getting v2.8.10 or v.2.8.11 to work under Wordpress 3.5 using PHP 5.4. I have it running and working on our development site, but when i moved the website to the live domain, it broke so there is one section on my site where the images won't load.
I am just wondering if there is a known issue with either Wordpress 3.5 or PHP 5.4.
When i go to the page that uses TimThumb I see broken images on the page. Right clicking and open the image in a new window gives me further details.
The error message says that TimThumb can't find the image eventhough when i take a the url from ?src parameter and open that url up in a browser, the image loads fine.
As a temporary solution, I've reverted back to a really, really old version of timthumb. This is not the best solution because I know this version is vulnerable. So i need to work out a final solution in the meantime.
Thanks in advance for any thoughts.
Old question but I'm going to post an answer here as I've just had issues with this. This might not answer everyone's TimThumb issues but it solved mine. I followed the trouble shooting guide at Binary Moon and had no joy. Managed to find this thread here on Themeforest;
http://themeforest.net/forums/thread/tim-thumb-problem/32860
The comment by Olegnax is the key. It's possibly a security config on the server which the hosts will have set (but the operative you deal with at the support desk might very well not know about). If you receive a 500 Internal Server Error message on images resized by TimThumb, try the following:
Set the file permission on timthumb.php to 700 (read, write, and execute for owner only).
Check the cache directory (folder) permissions. Setting it to 777 will give you a 500 – Internal Server Error. Set it to 711.

could add GD support to php interrupt a website services?

For one website, I need to add a litle script who resize images in php. For that, I used the GD functions. That worked very well in the dev machine, the problem is that in production doesn't work because php GD support isn't installed.
The things is, I'am not expert in server configurations and maintenance (my experience is mostly develop, and in others jobs other people were in charge of the servers, but this company is very small, so...), and I have a little fear that, if simple I install php-gd support, something wrong could happens to the productions server.
Any advice would be greatly appreciate.
While there is the possibility of something going wrong during the install, this can be mitigated by backups. Only thing I could imagine on the php side is concerning method definition - if somebody defined a method with the exact same name of a predefined mod_gd one, it will break.
If you want to be really sure: get a full backup of the production server, install it in a VM and test adding the GD support to it. If it doesn't break the VM install, it won't break the production server either.

When synchronizing in eclipse pdt - getting a blank gray window when comparing versions of a php file

I've installed Eclipse PDT Helios SR1 GTK for 64bit Linux (Ubuntu Maverick clean install).
I added the Subversive plugin for using Subversion, and installed the SVNKit 1.3.2 connector.
I'm using Sun's java and not the OpenJDK version.
When I synchronize a php project, and double click a php file for comparing the differences I made compared to the base revision - it opens a window of a compared file, but the window is empty - I see the gray background as if no file is opened.
When I open files which are not set as a PHP file, it works fine.
(If I'll take a file with a .module extension and define it as a php file in the Content Types preferences pane, it will act badly as described above. If I'll remove this definition, it will work [as if I compared a plain text file]).
Anybody has any idea why is this happening ?
If I missed any important information that will help diagnose or solve this issue, lemme know and I'll add it.
Thank you.
https://bugs.eclipse.org/bugs/show_bug.cgi?id=326194
There's a fix that you can install, although it's on a non-release update site.
Unbelievably, they still haven't fixed it in the main update site.

Categories