DPI, image size, cameras, websites, argh?



  • #region Rant

    So we've got a Wordpress site that some 3rd party has done for someone at work. This person is trying to upload some pictures to the site and sent a couple of us devs an email saying 'I'm trying to upload a file but it says it needs to be less than 2mb, anyone got an app that can reduce filesize?'

    Yes ... it's called Paint?

    So my first guess is that they are uploading a 10 megapixel camera image. Either that or a 1 megapixel bitmap...I'd sway more towards the camera situation

    It's annoying - I know that end users aren't supposed to know much about resolution and DPI, compression, web size vs photo/print size, but no matter how much I try to teach anyone it just goes in one ear and out the other - and apps and websites most of the time just expect the user to know that filesize is based on res/color depth/compression

    They think that when they send it to me and I run it through a batch script in photoshop that I've just waved some magic wand over it...

    I had some marketing company the other week ask one of my colleagues to "re-send the images but with a different DPI". I said to them "well... to be honest it's going to be exactly the same picture regardless of what the header says" - they were adamant that they couldn't accept the picture unless it was at 120 DPI or better. I send the same picture - same pixels (ok it was JPEGd so it probably lost a bit on the recompress) but with a different DPI in the header and they were happy with it.

    WTF?

    #endregion



  • @Charleh said:

    So we've got a Wordpress site that some 3rd party has done for someone at work. This person is trying to upload some pictures to the site and sent a couple of us devs an email saying 'I'm trying to upload a file but it says it needs to be less than 2mb, anyone got an app that can reduce filesize?'

    Is TRWTF that they should have some S/W (camera post-processing or so) that can take care of this for them...? Or that as devs.. you're not photographers/graphic artists?

    An alternative is that some CMS (Gallery is one) use ImageMagick to take care of processing server-side - you upload an image of any size, and it'll redo the size/DPI/etc for display at various different resolutions as well as thumbnail generation. It could be worthwhile seeing if there's a plugin of some kind that handles image processing.

    I suppose TRWTF is the site being created without proper use cases defining user processes, thus the gap between the final results and the users' workflow....



  • I recently worked on a site feature that would allow mobile phone users to upload pictures. From the phone, of course. The pictures were large; much larger than we needed. In the past I had expected people to have image editing software on their PC's and know how to use it. But in this case I realized that most phones have no image editing software! A guy takes a picture, and the phone camera gives him ten million pixels. Sure, that can be cut in resolution.But how? Mobile phones don't have image editing software! So our site takes any size image, and cuts it to the size it needs.



  • @Charleh said:

    but no matter how much I try to teach anyone it just goes in one ear and out the other

    You should see what happens when you try to explain to someone that digital files don't actually have any dimensions in it and it depends on the printer or screen resolution, and the same file will have different dimensions on different screens, and event that effect depends on actual dimensions, screen resolution, pixel density, etc etc...



  • @Cassidy said:

    An alternative is that some CMS (Gallery is one) use ImageMagick to take care of processing server-side - you upload an image of any size, and it'll redo the size/DPI/etc for display at various different resolutions as well as thumbnail generation. It could be worthwhile seeing if there's a plugin of some kind that handles image processing.
     

    Most sites do (including Wordpress), but PHP has image upload size limits, and IIRC the default configuration is for 2MB (which may have been plenty 10 years ago but is paltry with today's cameras).

     



  • @sprained said:

    Most sites do (including Wordpress), but PHP has image upload size limits, and IIRC the default configuration is for 2MB (which may have been plenty 10 years ago but is paltry with today's cameras).

    PHPs uploads are used for much more than just images, and a default of 2MB is just fine. It prevents DoS-style attacks and unnecessarily large temp files.



  • @AndyCanfield said:

    I recently worked on a site feature that would allow mobile phone users to upload pictures. From the phone, of course. The pictures were large; much larger than we needed. In the past I had expected people to have image editing software on their PC's and know how to use it. But in this case I realized that most phones have no image editing software! A guy takes a picture, and the phone camera gives him ten million pixels. Sure, that can be cut in resolution.But how? Mobile phones don't have image editing software! So our site takes any size image, and cuts it to the size it needs.


    Is that an android thing, by chance? I know when I send messages as MMS, my phone always tells me the photo is too big and offers to compress it for me, but I've never seen the Facebook app do that, so I've always wondered how that works.



  • @Master Chief said:

    @AndyCanfield said:

    I recently worked on a site feature that would allow mobile phone users to upload pictures. From the phone, of course. The pictures were large; much larger than we needed. In the past I had expected people to have image editing software on their PC's and know how to use it. But in this case I realized that most phones have no image editing software! A guy takes a picture, and the phone camera gives him ten million pixels. Sure, that can be cut in resolution.But how? Mobile phones don't have image editing software! So our site takes any size image, and cuts it to the size it needs.


    Is that an android thing, by chance? I know when I send messages as MMS, my phone always tells me the photo is too big and offers to compress it for me, but I've never seen the Facebook app do that, so I've always wondered how that works.

    iPhone will also cut down the photo for email or MMS (it requests that you choose a size to send, I assume so you can feel like you're in control of your data usage). I assume that's a more or less standard IOS thing, but you're right, the Facebook app doesn't... anything.



  • @dtech said:

    @sprained said:
    Most sites do (including Wordpress), but PHP has image upload size limits, and IIRC the default configuration is for 2MB (which may have been plenty 10 years ago but is paltry with today's cameras).

    PHPs uploads are used for much more than just images, and a default of 2MB is just fine. It prevents DoS-style attacks and unnecessarily large temp files.

     

    You may never have had a need for uploading larger files, but plenty of sites do (think video).  Since clearly there are websites out there that routinely accept large video files, there must be techniques for handling large uploads without risking DoS attacks.  PHP evidently doesn't implement these techniques, but that's neither here nor there.  What I was trying to point out is that this problem can't necessarily be solved with CMS plugins (as suggested by Cassidy) if you're using a PHP-based CMS on a server configured with a 2MB upload limit -- that's all.  (Although IIRC there are ways to get around this limit using Flash).

     



  • @sprained said:

    @dtech said:
    PHPs uploads are used for much more than just images, and a default of 2MB is just fine. It prevents DoS-style attacks and unnecessarily large temp files.

    You may never have had a need for uploading larger files, but plenty of sites do (think video).  Since clearly there are websites out there that routinely accept large video files, there must be techniques for handling large uploads without risking DoS attacks.  PHP evidently doesn't implement these techniques, but that's neither here nor there.  What I was trying to point out is that this problem can't necessarily be solved with CMS plugins (as suggested by Cassidy) if you're using a PHP-based CMS on a server configured with a 2MB upload limit -- that's all.  (Although IIRC there are ways to get around this limit using Flash).

    So, wait...you're saying that if you configure something, but want a different configuration, the software will respect the actual configuration and completely ignore your desires? That really sucks!



  • @boomzilla said:

    So, wait...you're saying that if you configure something, but want a different configuration, the software will respect the actual configuration and completely ignore your desires? That really sucks!
     

    I'm saying that the default configuration has a low upload limit.  And probably 95% of Wordpress instances out there (the OP was talking about Wordpress, right?) are on shared hosting where the user has absolutely no control over the PHP configuration.

    Yeah, I know, get better hosting, the hosting|PHP|Wordpress is TRWTF, etc.

    Really, all I am saying is give peas a chance it's not a problem that can be solved by installing a plugin or switching CMSes (unless you switch programming languages too, which most Wordpress users aren't about to do anyway).  If the server will not accept the upload, no amount of server-side processing is going to solve the problem.

     



  • @sprained said:

    Really, all I am saying is give peas a chance it's a problem that may require some server-side configuration as well as installing a plugin

    Alternatively.

    I mean, hell - it's a solvable problem, and the solution should really come from the service provider (web-end) than be an expectation/restriction upon the user ("you take photos that are too big - you need to learn how to use some additional software package to reduce the file size and dimensions").[1]

    However, you're right that just dropping a plugin won't be enough - I didn't make that clear from my post, but at the same time (admittedly) I didn't consider PHP limitations. Which is a big DOH moment for me, given that I've had to raise them in the past and been wary of the DoS opportunities it opened. The ClueBat? Thanks.

    Any photobucket/flikr users here? There a limit on image dimensions or file upload size?

    [1] Being on a board full of devs, am I about to open a can of worms here?



  • @sprained said:


    I'm saying that the default configuration has a low upload limit.  And probably 95% of Wordpress instances out there (the OP was talking about Wordpress, right?) are on shared hosting where the user has absolutely no control over the PHP configuration.

    Yeah, I know, get better hosting, the hosting|PHP|Wordpress is TRWTF, etc.

    Really, all I am saying is give peas a chance it's not a problem that can be solved by installing a plugin or switching CMSes (unless you switch programming languages too, which most Wordpress users aren't about to do anyway).  If the server will not accept the upload, no amount of server-side processing is going to solve the problem.

    Ah, yes, that's very different. So, your real point is that if you can't reconfigure your server to allow you to abuse your hosting privileges (I'm guessing that's how your provider would see it, anyways), then you're screwed.



  • @Cassidy said:

    @sprained said:

    Really, all I am saying is give peas a chance it's a problem that may require some server-side configuration as well as installing a plugin

    Alternatively.

    Yes, basically.  Although Wordpress already provides that facility anyway unless the server configuration is even more braindead than usual (requires GD or ImageMagick, IIRC, but most shared hosts offer at least one of the two).

    @Cassidy said:

    However, you're right
    that just dropping a plugin won't be enough - I didn't make that clear
    from my post, but at the same time (admittedly) I didn't consider PHP
    limitations. Which is a big DOH moment for me, given that I've had to
    raise them in the past and been wary of the DoS opportunities it opened.
    The ClueBat? Thanks.
     

    I'd posit that DoS is much more of a concern (for the web developer at least) for a publicly-editable site than for something like a typical Wordpress site where only a few presumably-trusted users will have upload privileges anyway. (If the general public gets access to upload files to your Wordpress site, you probably have bigger concerns than DoS).

    @boomzilla said:

    Ah, yes, that's very different. So, your real point is that if you
    can't reconfigure your server to allow you to abuse your hosting
    privileges (I'm guessing that's how your provider would see it,
    anyways), then you're screwed.

    I guess that's one way to look at it.  Or you could look at it as the hosting provider being too braindead to update PHP from the default configuration.  If 2MB was a reasonable limit in 2003, I don't see how 20MB would be problematic in 2012, given the way hardware/network resources (and allocations on shared hosting) have grown / become less expensive.

    Or you could look at it as the customer needing to educate themselves and find a web host that's capable of configuring their servers for typical modern usage patterns.  (Surveying a few providers my clients use, limits range from 2MB to 200MB these days).

     



  • @sprained said:

    I guess that's one way to look at it.  Or you could look at it as the hosting provider being too braindead to update PHP from the default configuration.  If 2MB was a reasonable limit in 2003, I don't see how 20MB would be problematic in 2012, given the way hardware/network resources (and allocations on shared hosting) have grown / become less expensive.

    Or you could look at it as the customer needing to educate themselves and find a web host that's capable of configuring their servers for typical modern usage patterns.  (Surveying a few providers my clients use, limits range from 2MB to 200MB these days).

    The sort of situation you're describing sounds like a shared server where you're not only not able to make much in the way of configuration changes, but are constantly screwed by the others sharing the same resources (CPU, DB, etc).

    Also, while I agree that 2MB seems pretty restrictive for a particular server (and maybe current use cases), I'd imagine that limits like this enable them to cram a lot more onto a particular shared server. Yeah, it's crap service, but you get what you pay for, and you can get VPS service for pretty cheap for a simple server. And if you're dealing with significant 3rd party content, you probably shouldn't be dicking around with such a limited service to begin with.



  • @boomzilla said:

    The sort of situation you're describing sounds like a shared server where you're not only not able to make much in the way of configuration changes, but are constantly screwed by the others sharing the same resources (CPU, DB, etc).

    Also, while I agree that 2MB seems pretty restrictive for a particular server (and maybe current use cases), I'd imagine that limits like this enable them to cram a lot more onto a particular shared server. Yeah, it's crap service, but you get what you pay for, and you can get VPS service for pretty cheap for a simple server. And if you're dealing with significant 3rd party content, you probably shouldn't be dicking around with such a limited service to begin with.

     

    Can't argue with any of that.

     



  • @Charleh said:

    I had some marketing company the other week ask one of my colleagues to "re-send the images but with a different DPI". I said to them "well... to be honest it's going to be exactly the same picture regardless of what the header says" - they were adamant that they couldn't accept the picture unless it was at 120 DPI or better. I send the same picture - same pixels (ok it was JPEGd so it probably lost a bit on the recompress) but with a different DPI in the header and they were happy with it.

    You should have made it more DPI... by reducing the physical size of the image (in inches) while maintaining the number of pixels! That'll teach them... :D



  • @ekolis said:

    You should have made it more DPI... by reducing the physical size of the image (in inches) while maintaining the number of pixels! That'll teach them... :D

    Uh, that's exactly what he did.

    What he should have done was scale the image way down while at the same time setting the DPI really high.



  • @Master Chief said:

    [quote user="AndyCanfield"]

    I recently worked on a site feature that would allow mobile phone users to upload pictures. From the phone, of course. The pictures were large; much larger than we needed. In the past I had expected people to have image editing software on their PC's and know how to use it. But in this case I realized that most phones have no image editing software! A guy takes a picture, and the phone camera gives him ten million pixels. Sure, that can be cut in resolution.But how? Mobile phones don't have image editing software! So our site takes any size image, and cuts it to the size it needs.


    Is that an android thing, by chance? I know when I send messages as MMS, my phone always tells me the photo is too big and offers to compress it for me, but I've never seen the Facebook app do that, so I've always wondered how that works.[/quote]

    I know my Nexus One comes set my default to like a jillion megapixels, despite the fact that the camera is so shaky/blury that the photos still look just as bad at 1024x768.



  • Are you for real? DPI is included in image headers for a reason, and the reason is because any sampled image was, in fact, sampled at a given number of [i]dots per inch[/i]. This is necessary to understand the physical size of the image. For instance, if you want to print it. Like you'd maybe want to do, if you were say, a member of a marketing company. Having the image come out correctly because [i]the DPI is correct[/i], vs. having the image come out correctly because you dicked around with scale factors for thirty minutes... I'll leave it to you which of those is less of a WTF.

    When somebody says "change the DPI of this image" they are telling you to resample the image. It's also a sign that the person in question knows more about imaging than you do. When you merely twiddled the DPI in the image header (I assume you increased it), you caused the image to shrink in terms of physical size. Probably somewhere on the other end compensated for your stupidity and just didn't tell you out of politeness.



  • @AndyCanfield said:

    I recently worked on a site feature that would allow mobile phone users to upload pictures. From the phone, of course. The pictures were large; much larger than we needed. In the past I had expected people to have image editing software on their PC's and know how to use it. But in this case I realized that most phones have no image editing software! A guy takes a picture, and the phone camera gives him ten million pixels. Sure, that can be cut in resolution.But how? Mobile phones don't have image editing software! So our site takes any size image, and cuts it to the size it needs.

    It's not a fucking hard problem to solve.  Think it through - you'll get it.  It took me all of four hours to solve the same exact problem for my photo site - and that's because I'm a retard.

     



  • I've fought this battle more than once. For example, I was told by a fairly respected website who wanted to run an article I wrote that they'd need "a head shot, at least 300 DPI". WTF. So I asked them how many pixels they needed in each direction, and they said "that doesn't matter... it just has to be at least 300 DPI". For a website. WTF.



  • @smxlong said:

    Are you for real? DPI is included in image headers for a reason, and the reason is because any sampled image was, in fact, sampled at a given number of dots per inch. This is necessary to understand the physical size of the image. For instance, if you want to print it. Like you'd maybe want to do, if you were say, a member of a marketing company. Having the image come out correctly because the DPI is correct, vs. having the image come out correctly because you dicked around with scale factors for thirty minutes... I'll leave it to you which of those is less of a WTF.

    When somebody says "change the DPI of this image" they are telling you to resample the image. It's also a sign that the person in question knows more about imaging than you do. When you merely twiddled the DPI in the image header (I assume you increased it), you caused the image to shrink in terms of physical size. Probably somewhere on the other end compensated for your stupidity and just didn't tell you out of politeness.

    You really need to get out more. What you just said is completely incorrect. It's pixels that matter, not DPI.



  • @smxlong said:

    Are you for real? DPI is included in image headers for a reason, and the reason is because any sampled image was, in fact, sampled at a given number of dots per inch. This is necessary to understand the physical size of the image. For instance, if you want to print it. Like you'd maybe want to do, if you were say, a member of a marketing company. Having the image come out correctly because the DPI is correct, vs. having the image come out correctly because you dicked around with scale factors for thirty minutes... I'll leave it to you which of those is less of a WTF.

    My DSLR camera samples images at about 3900 DPI, being a full-frame camera with 21.1 megapixels. While this correctly indicates the physical size of the sampled image, it's useless for printing. The camera also records a nominal DPI value of 72 in the headers, which would result in a printed image of an enormous 198x132cm in size. It's very unlikely that I'd need a physical image that large. However, the camera can't know what size of printed images I want, so there's no concept of "correct" DPI value here.

    I've also done several years worth of publications for a local club I'm a member of. Images usually range from 5x5cm to a full-page 15x21cm. However, I'll only know the final size after I've received the materials and put them in the layout. So again, there's no "correct" DPI value the author of the photo could have put in. Instead I take a look at what my program says the final DPI will be (as computed from pixel count divided by physical size), and if it's too small, I ask the author to send the image again with more pixels in it (not larger DPI, because the value in the headers isn't meaningful to me). If a larger version isn't available (perhaps because the original was taken with a crappy camera), I'll try to find a smaller spot for that photo.

    @smxlong said:

    When somebody says "change the DPI of this image" they are telling you to resample the image. It's also a sign that the person in question knows more about imaging than you do. When you merely twiddled the DPI in the image header (I assume you increased it), you caused the image to shrink in terms of physical size. Probably somewhere on the other end compensated for your stupidity and just didn't tell you out of politeness.

    No, when someone says "change the DPI of this image" they are being an idiot, or at the very least communicating their needs badly. What they actually mean is "this image doesn't have enough pixels to look good at the size I want". It's very rare that the printing size of an image can be decided when the image is created; consult to the examples above. If the digital image is a result of scanning in a physical object, the DPI value can be used to determine the size of that physical object, but it may or may not be the size in which the image will be reproduced.



  • @AndyCanfield said:

    Mobile phones don't have image editing software! So our site takes any size image, and cuts it to the size it needs.

    @hoodaticus said:

    It's not a fucking hard problem to solve.  Think it through - you'll get it.

    Dunno if you missed it in the textwall, but I think Andy's point is that the problem IS solved, and solved server-side - not requiring the user to perform any image processing.

    @realmerlyn said:

    So I asked them how many pixels they needed in
    each direction, and they said "that doesn't matter... it just has to be
    at least 300 DPI". For a website. WTF.

    .. so.. are you now saying you understand the difference between image density and image dimensions?



  • @smxlong said:

    DPI is included in image headers for a reason, and the reason is because any sampled image was, in fact, sampled at a given number of dots per inch.
     

    Who cares? If I can change the dpi value without modifying the image data, the sample rate meta-data is entirely meaningless.

    @smxlong said:

    This is necessary to understand the physical size of the image.

    As-is, yes, but changes are pretty much 100% that he's going to scale and crop the fuck out of it anyway, which means that all measurements are bollocks and all he needs as input is "a really big image", which has little to do with that little DPI value.

    @smxlong said:

    When somebody says "change the DPI of this image" they are telling you to resample the image.

    They are not. Maybe they want me to resample the image, but they are not saying that and thus I can't assume they do.

    The fact that Photoshop automatically resamples the image when you change the DPI isn't helping much either to lift confusion. :\ Makes people think that dpi-change = resampling.

    @smxlong said:

    It's also a sign that the person in question knows more about imaging than you do.

    If the person did, they would have provided dimensions in addition to the desired dpi. In other words, they would have offloaded the twiddle & scale work to me, which is silly/lazy, because they are working on the layout, and they can judge best what the right size or crop is for any supplied image.



  • @Cassidy said:

    @realmerlyn said:

    So I asked them how many pixels they needed in
    each direction, and they said "that doesn't matter... it just has to be
    at least 300 DPI". For a website. WTF.

    .. so.. are you now saying you understand the difference between image density and image dimensions?

     

    I don't understand what you're saying.

     



  • @smxlong said:

    Are you for real? DPI is included in image headers for a reason, and the reason is because any sampled image was, in fact, sampled at a given number of dots per inch. This is necessary to understand the physical size of the image. For instance, if you want to print it. Like you'd maybe want to do, if you were say, a member of a marketing company. Having the image come out correctly because the DPI is correct, vs. having the image come out correctly because you dicked around with scale factors for thirty minutes... I'll leave it to you which of those is less of a WTF.

    When somebody says "change the DPI of this image" they are telling you to resample the image. It's also a sign that the person in question knows more about imaging than you do. When you merely twiddled the DPI in the image header (I assume you increased it), you caused the image to shrink in terms of physical size. Probably somewhere on the other end compensated for your stupidity and just didn't tell you out of politeness.


    Not particularly interesting and a bit too heavy on the direct insults, but you got some bites. 6/10.



  • @dhromed said:

    I don't understand what you're saying.

    Only that I understood DPI to be relevent to the final display of the image, and the size of the image would be dependent upon the numnber of DPI of my chosen output (screen, dead tree, etc) x height/width dots.

    Mmm.. that doesn't make it any clearer, does it? Okay.. how about...  if someone wanted a 4" x 3" photoframed image, I'd use the DPI of their printer to determine what resolution the final image should be. I don't see how changing that DPI in the image headers affects that. Or have I got that wrong?



  • @Cassidy said:

    if someone wanted a 4" x 3" photoframed image, I'd use the DPI of their printer to determine what resolution the final image should be. I don't see how changing that DPI in the image headers affects that. Or have I got that wrong?
     

    The printer is probably in the range of several thousand dpi. I don't have exact numbers, but it's high enough to make the issue moot.  200-300dpi is the bare minimum for any semblance of sharpness in print, which means your image has to be 300×4 × 300×3 = 1200×900 pixels, and makes sure the image header says it's 300 dpi.

     

    Edit

    Unless you're talking about a desktop printer, in which case the max for an inkjet is something like 600 droplets per inch, and a common color laserjet goes up to around 1200 toner blots per inch.



  • @dhromed said:

    Unless you're talking about a desktop printer, in which case the max for an inkjet is something like 600 droplets per inch

    Erm.. yeah - Harry Homeowner wanting to print out and make his own Christmas cards, or adding a mugshot to my CV and running it off my 600DPI Deskjet. Sorry, shoulda made that clearer.

    Footnote: recently dropped a pile of digicam pics into the local photo processing place, was well impressed at how they came out, given the price they charged (4 british pennies per photo or so)



  •  Printing is pretty much a solved problem. :)



  • @smxlong said:

    Are you for real? DPI is included in image headers for a reason, and the reason is because any sampled image was, in fact, sampled at a given number of dots per inch. This is necessary to understand the physical size of the image. For instance, if you want to print it. Like you'd maybe want to do, if you were say, a member of a marketing company. Having the image come out correctly because the DPI is correct, vs. having the image come out correctly because you dicked around with scale factors for thirty minutes... I'll leave it to you which of those is less of a WTF.

    When somebody says "change the DPI of this image" they are telling you to resample the image. It's also a sign that the person in question knows more about imaging than you do. When you merely twiddled the DPI in the image header (I assume you increased it), you caused the image to shrink in terms of physical size. Probably somewhere on the other end compensated for your stupidity and just didn't tell you out of politeness.

    Thanks for your incorrect assumptions on DPI and what it means. My favourite bit was where you said that changing the DPI of the image means resampling it.

    So when I print the same picture at 600 DPI (tiny) and 120 DPI (massive) using the windows printing wizard, does that mean my printer is resampling my image?

    Also - I'd like to point out that this particular image was for web use only. Noone was printing it - it was a photo that was going to go onto a CMS driven website. I spoke to the person in question before I sent it and they told me that it needed to be at least 120 DPI or "it would be too blurry". That's as much as they could explain. I didn't argue - I've learned enough to know that in the 10 minutes I'd waste trying to educate them on why the DPI wouldn't matter, I could have sent them the 120 DPI version and been on my way to lunch



  • @sprained said:

    @dtech said:

    @sprained said:
    Most sites do (including Wordpress), but PHP has image upload size limits, and IIRC the default configuration is for 2MB (which may have been plenty 10 years ago but is paltry with today's cameras).

    PHPs uploads are used for much more than just images, and a default of 2MB is just fine. It prevents DoS-style attacks and unnecessarily large temp files.

     

    You may never have had a need for uploading larger files, but plenty of sites do (think video).  Since clearly there are websites out there that routinely accept large video files, there must be techniques for handling large uploads without risking DoS attacks.  PHP evidently doesn't implement these techniques, but that's neither here nor there.  What I was trying to point out is that this problem can't necessarily be solved with CMS plugins (as suggested by Cassidy) if you're using a PHP-based CMS on a server configured with a 2MB upload limit -- that's all.  (Although IIRC there are ways to get around this limit using Flash).

     

    I got a request to be able to upload a 2.5 GB file into a PHP app. (Moodle) Of course PHP stores the limit in a signed int, so setting it that high wrapped into negative, preventing all files from uploading. It was a zip file containing video files: we just removed extra encodings and got it under 600MB.

    And I'm not sure if flash player itself can split a file, but air could. Load it into a ByteArray, slice it up and send in separate requests. Normal flash upload doesn't give progress events but this method can hack around it.



  • @dhromed said:

    I don't understand what you're saying.


    Upon review of this thread, and deeper reflection, I think I'm also saying that... I are a blind get and can't tell the difference between smxlong and realmerlyn.

    Does the cluebat do eye tests? I must have fulfilled my quota of self-LARTs by now.



  • @atipico said:

    You should see what happens when you try to explain to someone that digital files don't actually have any dimensions in it
    Really?  That's not what this says.



  • Yes, it doesn't say that, but it also doesn't say the opposite. It says JPG files have a "header" of sort indicating its width and height in pixels. You know, those little non-dimensional image units. You can't measure height and width of a pixel because it fucking doesn't have it, that's why the DPI or PPI value is needed to know the actual physical size.

    "To make it very simple to understand, let's say we have an image that's 5000 pixels wide and 3000 pixels high. It has a "resolution" of 5000x3000. This resolution spec has no mention of how many of those pixels represent an inch. It's just a fixed size." -- http://www.danheller.com/tech-dpi.html

    That's why you explicitly puts an information at the header defining the size it WILL HAVE when printed. While on digital format, it doesn't have an actual dimensional size.

    You know what? Read this: http://www.webdesignerdepot.com/2010/02/the-myth-of-dpi/



  • Also, I have no idea what is a JPEG sampling factor.



  • The JPEG frame header doesn't contain any physical size information, since it's unnecessary for decoding, but the JFIF APP0 header (which is pretty much required for a JPEG file) allows to define pixel density in dots per inch or dots per centimetre.



  • @Spectre said:

    The JPEG frame header doesn't contain any physical size information, since it's unnecessary for decoding, but the JFIF APP0 header (which is pretty much required for a JPEG file) allows to define pixel density in dots per inch or dots per centimetre.

    It's a bird! It's a plane! It's..

     

    <font size="7">Specification Lad!!!</font>



  • quoting myself: "an information at the header defining the size it WILL HAVE when printed. While on digital format, it doesn't have an actual dimensional size."

    It's an indication. Two pictures, can contain the same exact image pixels and image A being 72 dpi and image B being, dunno, 300 dpi. Both will have same size in bytes (almost, see next phrase) and same height and width in pixels. The difference will be a few bytes in the header, the bytes that indicate the DPI.



  • Thanks for your incorrect assumptions on DPI and what it means. My favourite bit was where you said that changing the DPI of the image means resampling it.

    An image has a true physical size given by its DPI. If you change the DPI without resampling, you are changing the physical size of the image. But you aren't being asked to change the physical size of the image, you are being asked to change its DPI. The only way that can be accomplished is to resample.

    So when I print the same picture at 600 DPI (tiny) and 120 DPI (massive) using the windows printing wizard, does that mean my printer is resampling my image?

    Yes. How else would the image become larger if all you've done is change a few values in the image header? The DPI of the printer is FIXED (it may have more than one possibility but it can't be set to just anything you please). The DPI of the image is not fixed. If the image is printing at different sizes then something somewhere is resampling the image. It could be the print app, it could be the driver, or it could be the printer itself which does it. But it happens somewhere. Printers do not work at arbitrary resolutions.



  • @morbiuswilters said:

    @Spectre said:

    The JPEG frame header doesn't contain any physical size information, since it's unnecessary for decoding, but the JFIF APP0 header (which is pretty much required for a JPEG file) allows to define pixel density in dots per inch or dots per centimetre.

    It's a bird! It's a plane! It's..

     

    <font size="3">Specification Lad!!!</font>

    Specification Lad, actually.



  • @smxlong said:

    Thanks for your incorrect assumptions on DPI and what it means. My favourite bit was where you said that changing the DPI of the image means resampling it.

    An image has a true physical size given by its DPI. If you change the DPI without resampling, you are changing the physical size of the image. But you aren't being asked to change the physical size of the image, you are being asked to change its DPI. The only way that can be accomplished is to resample.

    So when I print the same picture at 600 DPI (tiny) and 120 DPI (massive) using the windows printing wizard, does that mean my printer is resampling my image?

    Yes. How else would the image become larger if all you've done is change a few values in the image header? The DPI of the printer is FIXED (it may have more than one possibility but it can't be set to just anything you please). The DPI of the image is not fixed. If the image is printing at different sizes then something somewhere is resampling the image. It could be the print app, it could be the driver, or it could be the printer itself which does it. But it happens somewhere. Printers do not work at arbitrary resolutions.

    So, to sum up this tiresome thread before I murder you all: smxlong is technically correct about DPI vs. resolution. However, in this particular case (and in most cases, because most people don't know jack shit about DPI vs. resolution) Charleh was correct because the image was going on the web (important context which he left out of the OP).



  • @Spectre said:

    @morbiuswilters said:

    @Spectre said:

    The JPEG frame header doesn't contain any physical size information, since it's unnecessary for decoding, but the JFIF APP0 header (which is pretty much required for a JPEG file) allows to define pixel density in dots per inch or dots per centimetre.

    It's a bird! It's a plane! It's..

     

    <font size="3">Specification Lad!!!</font>

    Specification Lad, actually.

    Are you drunk? Check again, that's what I wrote.



  • @morbiuswilters said:

    So, to sum up this tiresome thread before I murder you all: smxlong is technically correct about DPI vs. resolution. However, in this particular case (and in most cases, because most people don't know jack shit about DPI vs. resolution) Charleh was correct because the image was going on the web (important context which he left out of the OP).

    Since the beginning of my career the only fields I work in are image processing and print technologies. In those fields the term "DPI" is equivalent to "resolution" and the two are interchanged freely. It is a continuing source of befuddlement that laypersons insist on using the term "resolution" to mean "the width and height of something in pixels." When we in the field want to refer to that, we say "the width and height of something in pixels."



  • @smxlong said:

    It is a continuing source of befuddlement that laypersons insist on using the term "resolution" to mean "the width and height of something in pixels." When we in the field want to refer to that, we say "the width and height of something in pixels."

    6/10



  • @smxlong said:

    @morbiuswilters said:
    So, to sum up this tiresome thread before I murder you all: smxlong is technically correct about DPI vs. resolution. However, in this particular case (and in most cases, because most people don't know jack shit about DPI vs. resolution) Charleh was correct because the image was going on the web (important context which he left out of the OP).

    Since the beginning of my career the only fields I work in are image processing and print technologies. In those fields the term "DPI" is equivalent to "resolution" and the two are interchanged freely. It is a continuing source of befuddlement that laypersons insist on using the term "resolution" to mean "the width and height of something in pixels." When we in the field want to refer to that, we say "the width and height of something in pixels."

    Yeah, but it's firmly ingrained by now, so you should probably just get used to it. It seems pointlessly pedantic to pretend you don't know that when most people say "resolution" what they mean is "the number of pixels in an image".



  • @smxlong said:

    Thanks for your incorrect assumptions on DPI and what it means. My favourite bit was where you said that changing the DPI of the image means resampling it.

    An image has a true physical size given by its DPI. If you change the DPI without resampling, you are changing the physical size of the image. But you aren't being asked to change the physical size of the image, you are being asked to change its DPI. The only way that can be accomplished is to resample.

    Three points to consider:

    1. To increase the dpi without changing physical size, you'll have to resample the image to have more pixels than original. This will not add more information to the image, and depending on filtering may even lose information, so the end result isn't any better than reproducing the image at lower dpi (and may be worse).
    2. What publishing or printing software doesn't allow you to specify the physical size of the image independently of whatever is in the headers? As I said previously, in most cases it's the layout guy who decides how large the image will be, not the guy who made the image.
    3. The original context was a website, and I've yet to see a website layout that's based on physical units rather than pixels. Thus, dpi is irrelevant in this context.


  • @smxlong said:

    An image has a true physical size given by its DPI.

    Incorrect. DPI is a ratio - the image has a true physical size given by the pixel dimensions (dots) multiplied by the density (DPI) to arrive at a resolved image in meatspace. The physical size of the image can be adjusted by altering the DPI of the presentation later (printer/monitor/etc) or by cropping/rescaling the physical dots whilst keeping the DPI fixed.

    The DPI in the header only documents information about the sample quality used to capture the original image; if I open it that image in some processing software and save it under a different name, will the header contain the DPI setting of my monitor, or of the scanner used to acquire the image originally?

    @morbiuswilters said:

    It seems pointlessly pedantic to pretend you don't know that when most people say "resolution" what they mean is "the number of pixels in an image".

    I took "resolution" to mean "dimensions" for years, given that several OSen use the term in that way (and many monitor manufacturers too, in the older CRT days). However, I've since taken it as "quality" when researching digicams - I've read "greater resolution" as packing more pixies per inch (DPI) and "brighter and more vibrant resolution on your holiday snaps" with a printing service.

    I think, fundamentally, it means "the way in which we resolve your ones and zeros to an image" and it's been used to mean "dimensions" for years that people like smxlong have given up trying to correct. I've stopped telling people SATA is also IDE, and acknowledged to people at work that we are rebooting the internet.

    And don't get me started on hacker/cracker.

     


Log in to reply
 

Looks like your connection to What the Daily WTF? was lost, please wait while we try to reconnect.