OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



bugs / problems with image upload

Are you responsible for making OJS work -- installing, upgrading, migrating or troubleshooting? Do you think you've found a bug? Post in this forum.

Moderators: jmacgreg, btbell, michael, bdgregg, barbarah, asmecher

Forum rules
What to do if you have a technical problem with OJS:

1. Search the forum. You can do this from the Advanced Search Page or from our Google Custom Search, which will search the entire PKP site. If you are encountering an error, we especially recommend searching the forum for said error.

2. Check the FAQ to see if your question or error has already been resolved.

3. Post a question, but please, only after trying the above two solutions. If it's a workflow or usability question you should probably post to the OJS Editorial Support and Discussion subforum; if you have a development question, try the OJS Development subforum.

bugs / problems with image upload

Postby jmir » Mon May 28, 2007 9:06 am

In my installation, I am experiencing the following problems in "Edit a Layout Galley" (editor/editGalley/)


1) uploading png files leads to

Errors occurred processing this form:

- Invalid image format. Accepted formats are .gif, .jpg, and .png.

2) uploading jpg files leads to no problems

3) uploading gif files leads to strange symptoms, such as all images disappearing from the list of images after uploading the gif file (but when I click cancel and then return to the "edit galley" page, the gif file IS uploaded, however, in the pdf file the image sometimes appears broken (sometimes not - I am wondering if it has to do with different gif subtypes 87a vs 89a, alpha etc.)

4) Clicking DELETE as "action" to delete an image file has no effect. I have to delete the entire galley in order to delete images.

I am not sure if this is an OJS bug, or caused by some customizations we did here (including URL rewrite rules), or a combination of both (which I almost suspect).

Any explanations for this strange behaviour?
jmir
 
Posts: 74
Joined: Mon Feb 26, 2007 12:16 am

Postby asmecher » Mon May 28, 2007 3:50 pm

Hi Gunther,

I don't know if your modifications might have affected this, but with a stock installation of OJS 2.1.1, this would indicate to me that your magic.mime database is probably old or incompatible with your installation of PHP. Have a look at http://www.php.net/manual/en/function.mime-content-type.php for information on the function OJS uses to determine file types; if your PHP install doesn't support this function (you can check by calling function_exists('mime_content_type') and checking the return value), OJS works around it by executing the UNIX standard "file" tool via command line.

I don't know what would cause PDF images to stop working; I suppose it might be possible to have created your PDFs without embedding the images themselves...?

Rewrite rules or modifications might've caused #4; you'll have to investigate a little further. We haven't had problems like this with OJS 2.1.1.

Regards,
Alec Smecher
Public Knowledge Project Team
---
Don't miss the First International PKP Scholarly Publishing Conference
July 11 - 13, 2007, Vancouver, BC, Canada
http://ocs.sfu.ca/pkp2007/
asmecher
 
Posts: 9212
Joined: Wed Aug 10, 2005 12:56 pm

Postby jmir » Wed May 30, 2007 7:48 am

function_exists('mime_content_type') returns a 1, implying that the function exists. Any other ideas on what could go wrong with the MIME type recognition, or ideas on how to troubleshoot this problem?

My settings / environment: see http://www.jmir.org/phpinfo.php
jmir
 
Posts: 74
Joined: Mon Feb 26, 2007 12:16 am

Postby asmecher » Wed May 30, 2007 10:08 am

Hi Gunther,

What I'd do in this case is manually call the mime_content_type function on a set of sample files, some of which you know to work, some of which are causing problems. Upload the images into a directory and place something like the following script in it:
Code: Select all
<?php

$files = array('image1.gif', 'image2.jpg', 'image3.png', 'image4.gif');

foreach ($files as $file) {
    echo $file . ': ' . mime_content_type($file) . '<br/>';
}

?>
Of course, you'll need to modify the filenames in the above list to suit.

There's information on debugging at http://www.php.net/manual/en/function.mime-content-type.php; I know some distributions of PHP come with a magic.mime file, and it may be the case that your PHP installation is configured to use another file that may or may not be compatible.

Regards,
Alec Smecher
Public Knowledge Project Team
---
Don't miss the First International PKP Scholarly Publishing Conference
July 11 - 13, 2007, Vancouver, BC, Canada
http://ocs.sfu.ca/pkp2007/
asmecher
 
Posts: 9212
Joined: Wed Aug 10, 2005 12:56 pm


Return to OJS Technical Support

Who is online

Users browsing this forum: Yahoo [Bot] and 1 guest

cron