Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vertical Image Has an Horizontal Placeholder #1557

Open
Zeriuno opened this issue Oct 24, 2014 · 5 comments
Open

Vertical Image Has an Horizontal Placeholder #1557

Zeriuno opened this issue Oct 24, 2014 · 5 comments

Comments

@Zeriuno
Copy link

Zeriuno commented Oct 24, 2014

Noticed with three pictures, taken with a Nikon D70
trovebox-vertical-2
trovebox-vertical-3

@jmathai
Copy link
Member

jmathai commented Oct 24, 2014

I suspect that the photo's width/height are off. Can you see what they are and verify accuracy?

Can check by simply going to /photo/:id/view.json and looking for the height/width attributes.

@Zeriuno
Copy link
Author

Zeriuno commented Oct 24, 2014

Not sure if I found what I was supposed to look for, so I share the picture with you

https://danielepitrolo.trovebox.com/p/171/token-a311751128

<script> var initData = {"id":"171","owner":"d.pitrolo@gmx.com","actor":"d.pitrolo@gmx.com","appId":"danielepitrolo.openphoto.me","host":"d1odebs29o9vbg.cloudfront.net","title":null,"description":null,"key":null,"hash":"5a394288fd16500b4af541ac73a4d3ef3645c3be","size":"5258","width":"3040","height":"2014","rotation":"0",

@jmathai
Copy link
Member

jmathai commented Oct 24, 2014

This is a RAW and we're using exiftool to get dimensions.

Here's what exiftool gives.

exiftool Downloads/2003-12-07\ Teiera\ e\ tazza\ Dsc_0011.nef
ExifTool Version Number         : 9.69
File Name                       : 2003-12-07 Teiera e tazza Dsc_0011.nef
Directory                       : Downloads
File Size                       : 0 bytes
File Modification Date/Time     : 2014:10:24 13:34:39-07:00
File Access Date/Time           : 2014:10:24 13:34:39-07:00
File Inode Change Date/Time     : 2014:10:24 13:34:39-07:00
File Permissions                : rw-r--r--
Error                           : File format error

Source for RAW support isn't merged yet but here's the command.

  private function getImageSizeFromRaw($photo)
  {
    if(!is_executable($this->config->modules->exiftool))
      return getimagesize($photo);

    $cmd = sprintf('%s %s | egrep %s | awk %s', $this->config->modules->exiftool, escapeshellarg($photo), escapeshellarg('^Image Size +:'), escapeshellarg('{print $4}'));
    $size = trim(exec($cmd));
    return explode('x', $size);
  }

FYI the API url would look like this with the token, https://danielepitrolo.trovebox.com/photo/171/token-a311751128/view.json

Related #1443 and #1400

@Zeriuno
Copy link
Author

Zeriuno commented Oct 24, 2014

Just letting you know that in #1400 my RAW was uploaded, here #1400 (comment)

@Zeriuno
Copy link
Author

Zeriuno commented Oct 24, 2014

Posting here because it looks like it might be related: I also have a few RAW whos thumbnail is rectangular but displays a portion of the picture in horizontal. Those are picture that were horizontal and that I rotated.

screenshot 2014-10-24 alle 23 47 43

Here is the view.json for one of them:

{"message":"Photo 18c","code":200,"result":{"id":"18c","owner":"d.pitrolo@gmx.com","actor":"d.pitrolo@gmx.com","appId":"danielepitrolo.openphoto.me","host":"d1odebs29o9vbg.cloudfront.net","title":null,"description":null,"key":null,"hash":"e9e51d28cc12fea03b9a685d6e45a81a33c01c07","size":"5091","width":"2014","height":"3040","rotation":"90","latitude":null,"longitude":null,"views":"0","status":"1","permission":"0","license":"","dateTaken":"1130737201","dateTakenDay":"30","dateTakenMonth":"10","dateTakenYear":"2005","dateUploaded":"1414186736","dateUploadedDay":"24","dateUploadedMonth":"10","dateUploadedYear":"2014","dateSortByDay":"20051030021958","filenameOriginal":"2005-10-30 Ponteranica, ombre delle sculture di Don Chisciotte e Sancho Panza _DSC3997.nef","pathOriginal":"http:\/\/d1odebs29o9vbg.cloudfront.net\/original\/200510\/2005-10-30-Ponteranica--ombre-delle-sculture-di-Don-Chisciotte-e-Sancho-Panza-_DSC3997-544ac6f07d57c.nef","pathBase":"http:\/\/d1odebs29o9vbg.cloudfront.net\/base\/196912\/2005-10-30-Ponteranica--ombre-delle-sculture-di-Don-Chisciotte-e-Sancho-Panza-_DSC3997-8e836f.nef","albums":["1a"],"groups":"","tags":["2005","October","Ponteranica","ombre","scultura"],"timestamp":"2014-10-24 21:38:58","active":"1","exifCameraMake":"NIKON CORPORATION","exifCameraModel":"NIKON D70","exifFNumber":4.2,"exifExposureTime":"10\/25","exifFocalLength":38,"pathDownload":"https:\/\/danielepitrolo.trovebox.com\/photo\/18c\/download","url":"https:\/\/danielepitrolo.trovebox.com\/photo\/18c\/view"}}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants