equal
deleted
inserted
replaced
2503 useNearest := Dialog |
2503 useNearest := Dialog |
2504 confirmWithCancel:(resources |
2504 confirmWithCancel:(resources |
2505 string:'Image requires %1 colors.\ColorMap has only space for %2\\Use nearest (or map to first color) ?' |
2505 string:'Image requires %1 colors.\ColorMap has only space for %2\\Use nearest (or map to first color) ?' |
2506 with:usedColors size |
2506 with:usedColors size |
2507 with:(1 bitShift:depth)) withCRs |
2507 with:(1 bitShift:depth)) withCRs |
2508 labels:(resources array:#('cancel' 'first' 'nearest')). |
2508 labels:(resources array:#('Cancel' 'First' 'Nearest')). |
2509 useNearest isNil ifTrue:[ |
2509 useNearest isNil ifTrue:[ |
|
2510 colorMapMode value:prevMode. |
2510 ^ self "/ cancel |
2511 ^ self "/ cancel |
2511 ]. |
2512 ]. |
2512 ] |
2513 ] |
2513 ] |
2514 ] |
2514 ] ifFalse:[ |
2515 ] ifFalse:[ |
2517 (usedColors conform:[:clr | newColorMap includes:clr]) ifFalse:[ |
2518 (usedColors conform:[:clr | newColorMap includes:clr]) ifFalse:[ |
2518 useNearest := Dialog |
2519 useNearest := Dialog |
2519 confirmWithCancel:(resources |
2520 confirmWithCancel:(resources |
2520 string:'Not all colors are present in the new colormap.\\Map missing ones to nearest (or map to first color) ?' |
2521 string:'Not all colors are present in the new colormap.\\Map missing ones to nearest (or map to first color) ?' |
2521 ) withCRs |
2522 ) withCRs |
2522 labels:(resources string:#('cancel' 'first' 'nearest')). |
2523 labels:(resources string:#('Cancel' 'First' 'Nearest')). |
2523 useNearest isNil ifTrue:[ |
2524 useNearest isNil ifTrue:[ |
|
2525 colorMapMode value:prevMode. |
2524 ^ self "/ cancel |
2526 ^ self "/ cancel |
2525 ]. |
2527 ]. |
2526 ]. |
2528 ]. |
2527 ]. |
2529 ]. |
2528 |
2530 |
2532 newImage depth:depth. |
2534 newImage depth:depth. |
2533 oldFileName := oldImage fileName. |
2535 oldFileName := oldImage fileName. |
2534 |
2536 |
2535 Image imageErrorSignal handle:[:ex| |
2537 Image imageErrorSignal handle:[:ex| |
2536 Color colorErrorSignal handle:[:ex| |
2538 Color colorErrorSignal handle:[:ex| |
|
2539 colorMapMode value:prevMode. |
2537 imageEditView undo. |
2540 imageEditView undo. |
2538 ^ self warn:(resources string:'Conversion failed !!') |
2541 ^ self warn:(resources string:'Conversion failed !!') |
2539 ] do:[ |
2542 ] do:[ |
2540 newImage := Image newForDepth:depth. |
2543 newImage := Image newForDepth:depth. |
2541 newImage width:oldImage width height:oldImage height depth:depth. |
2544 newImage width:oldImage width height:oldImage height depth:depth. |