Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: CMYK photos and piceditor.php  (Read 3228 times)

0 Members and 1 Guest are viewing this topic.

sjordan

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 52
CMYK photos and piceditor.php
« on: July 29, 2006, 03:16:51 am »

I have searched the forum and found that GD has problems with CMYK images, but I'm using ImageMagik

I have successfully uploaded a CMYK jpg file. The thumbnail and normal sizes were created and I can view the image in the album.

The only area that seems to have trouble is when I click "crop and rotate', the picEditor.php popup page is blank.

Anyone with similar experience and/or have solved this?

thanks in advance.

cpg v. 1.48
Logged

OmegaGOD

  • Supporter
  • Coppermine frequent poster
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 346
  • I approve.
Re: CMYK photos and piceditor.php
« Reply #1 on: July 29, 2006, 05:55:45 am »

sjordan,

Is there a reason why you are using CMYK for display purposes? CMYK is a subset of the RBG color space and all monitors display using RBG color space. I think if you convert your images to RGB, you will solve your problem. Because RGB is a larger color space, you won't be losing any color depth when converting.

Hope this helps.

--OmegaGOD
Logged
Please do not PM me with support questions. Please read the manual and then if posting questions please place them in the proper sub-boards.

sjordan

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 52
Re: CMYK photos and piceditor.php
« Reply #2 on: July 29, 2006, 06:09:08 am »

I'm personally not using CMYK. I allow users to create albums and upload photos. One of my users actually tried to upload the photo and notified me of the errors.

So in this instance, I was more concerned with my user's experience. Doesn't look good if my gallery is throwing errors.

Thank you.
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: CMYK photos and piceditor.php
« Reply #3 on: July 29, 2006, 07:10:23 am »

Well, users could make all kinds of mistakes or try to upload broken images of all types. You won't be able to get rid of error messages that happen when the users does something wrong. You already realized that part of the problem lies in the image library coppermine uses. This being said, coppermine doesn't have total control over images uploaded, but uses GD or ImageMagick - you could hardly instruct those libraries to do anything else but throw an erro, which is subsequently being displayed within coppermine. There are several other user errors that could result in similar things (e.g. renaming a file from foobar.bmp to foobar.jpg and subsequently uploading such a wannabe-jpeg to the gallery; although some desktop apps are tolerant towards such user errors, the image libraries coppermine uses are not).
Bottom line: as OmegaGOD suggested, there's little you could possibly do to avoid such errors in the future.
Logged

sjordan

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 52
Re: CMYK photos and piceditor.php
« Reply #4 on: July 29, 2006, 07:22:25 am »

OmegaGOD & GauGau:

Thank you both. It's not so much that an error message is being displayed. Rather, it seemed odd that the photo was successfully uploaded (apparently) -- evidenced by the fact that the thumb_ and normal_ files were created. I can see the thumbnail and the normal photo when I navigate to displayimage.php, but clicking on picEditor.php renders a blank screen. So, it seems more a mysterious matter on inconsistent. One would expect that if the file got successfully pass the upload stage then each subsequent interaction should be successful.

Bottom line (to borrow a line from GauGau): I'm more intrigued by why would the upload, thumbnail and normal creation work, then other displays not work (all within the same CPG install).
« Last Edit: July 29, 2006, 07:33:53 am by sjordan »
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: CMYK photos and piceditor.php
« Reply #5 on: July 29, 2006, 07:41:22 am »

Hm, not sure about that: GD can't handle CMYK pics at all, so it shouldn't be capable to create thumbnails from such files. I'm not sure about ImageMagick though. However, the set of commands issued by PHP to create a thumbnail differs from the commands issued on the piceditor screen. So this discrepany may be caused by some commands being more tolerant against "exotic" files than others.
After all, I wouldn't be too bothered about this though - should happen only rarely, as most users don't even have pic editors that support CMYK, so there shouldnÄt be many CMYK jpegs around anyway.
Logged

sjordan

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 52
Re: CMYK photos and piceditor.php
« Reply #6 on: July 29, 2006, 07:59:32 am »

GauGau:

Thank you. I'll take your advice and not stress it. CPG can't be all things to all people. It's a great program.

I might stick a bit of code into upload.php to check for CMYK images and issue a warning (or even reject the file). From php.net documentation:
Quote
getimagesize with JPG images, two extra indexes are returned: channels and bits. channels will be 3 for RGB pictures and 4 for CMYK pictures.

Thanks again
Logged
Pages: [1]   Go Up
 

Page created in 0.016 seconds with 20 queries.