WP Photo Album Plus
[resolved] Upload tool rejects JPGs but FTP-Import OK (7 posts)

  1. trbhicks
    Posted 1 year ago #

    Hi, Jacob. Wonderful plugin, donation follows as soon as I learn how powerful it really is.

    Found this asked, but not resolved, in the support files. The upload tool rejects my small (<300KB) JPGs with "ERROR: Unable to retrieve image size of foo.jpg"

    But when I FTP them in and Import, no problem.

    Files were created pn Photoshop CS6 for Mac via Save As/JPG.
    Just checked and was surprised to see format "Progressive" - I usually use Standard.
    Resaved as Standard; upload failed again.

    I'm baffled. Not too concerned because I was planning to FTP everything anyway, but I hate to leave a challenge unsolved.


  2. Jacob N. Breetvelt
    Plugin Author

    Posted 1 year ago #

    I hate to leave a challenge unsolved.

    I can only agree!!

    The errormessage tells me that the php function getimagesize($file) returns false, what i interprete as it not being an image. See the doc on getimagesize().

    Did you try uploading a photo straight from the camera into the pc without editing to the site? Maybe the mac spoils it by stripping the metadata.

  3. trbhicks
    Posted 1 year ago #

    Finally back at this, which is still failing. Running tests to see whether any files do NOT get this error (so far they all do; not all were from my camera, but all have been edited and saved as JPG from CS6 Photoshop)

    Two things I found suggest that getimagesize has limitations that can be handled.
    These might interest you:

    (1) One website suggested
    In list($width, $height) = getimagesize($file_image);
    use @ before getimagesize($file_image);
    (i.e.) list($width, $height) = @getimagesize($file_image);

    (2) Another says getimagesize() requires spaces written as %20 and possibly some other special characters in the URL Solution: encode the filename element of a URL. Implementation:
    public function create($originalPath, $newPath, $width, $height, $crop = false) { if ($this->isUrl($originalPath)) $originalPath = $this->encodeUrl($originalPath); // here it continues with the original code $imageSize = @getimagesize($originalPath);

  4. Jacob N. Breetvelt
    Plugin Author

    Posted 1 year ago #

    (1) @ only suppresses the errormessage, does not fix anything.

    (2) Filename should be how they come from the camera e.g: HPIM2345 or DSC1003

    Descriptions e.g.: My Daddy's "Fantastic" party
    should never be used as filenames, that are descriptions or photonames in wppa+. Especially single and double quotes are very tricky when used in HTML GET and POST actions.

    If 'normal' filenames - like PHOTO0002 - also fail, and only at upload, not at import, verify the php's temp directory ( php_ini setting: upload_tmp_dir ) is reaable and writeable.

    BTW Wppa+ uses filepaths here, not urls.

  5. Jacob N. Breetvelt
    Plugin Author

    Posted 1 year ago #

    You may also mail me an unwilling photo so i can try it myself.

    Mail to: opajaap at opajaap dot nl

  6. Jacob N. Breetvelt
    Plugin Author

    Posted 1 year ago #

    Please be aware that i made some important changes in version 5.4.8 because of security reasons. People were using filenames with embedded html code. So, please make sure you are at rev 5.4.9 where a few filename related inconsistencies were fixed, and try again.

    Please also tell me what platform you are working on ( local pc where you are uploading from ) and if you have this problem on both backend and frontend uploads.

  7. Jacob N. Breetvelt
    Plugin Author

    Posted 1 year ago #

    This was a misconfig of the servers php
    Fixed offline

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WP Photo Album Plus
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic